Html – alt vs title vs filename


For example:

<img alt="Facebook logo" src="" title="Link to home page"/>

Which has more importance for Search engine, Alt text or image file name or title or all?

Best Solution

In general, the three most important things for image SEO are:

  • Image filename. Make it descriptive, i.e. "TabbyCat.jpg" or "tabby-cat.jpg" rather than "DSC0001.jpg".
  • Alt text. This should generally describe the image in a short phrase or sentence, e.g. "a picture of my cat, Tabby." Think of it like you were telling someone who can't see the image.
  • Text surrounding the image. This seems to be pretty important. The text that's close to the image would generally reference it in some way (e.g. in the same paragraph, or a caption under the image).

The title text is generally only important for links - it shows a tooltip to users when they hover the mouse over it. For images, you would rarely need that since it's either obvious what the image is or the text around it describes it fine. However sometimes you may want a little more info for users that attempt to look for it (various web comics put a little joke or addendum in the title text).

Finally, remember this: do what's best for users, not search engines.