An alt tag is text used to describe an image on your website. It provides a website accessibility function for visitors using screen readers and provides search engines with a better understanding of the images on your website.
The SEO Office Hours notes shown here compile the best straight-from-Google tips to help you ensure your image alt text is optimized for users and search alike.
Google Image Search usually doesn’t find images specified within a CSS background attribute
A question was asked in this session about whether a pure CSS background image would be picked up by Google Image Search. John relayed that, to his knowledge, this would not be picked up by Google Image Search. To help Google find these images, it’s best to make sure it’s linked within the page, if you care about the image appearing in Image Search. For Image Search, Google’s algorithm mostly looks at the image alt tag, the title tag, and the text around the image on a page.
Alt text associated with a linked image is treated the same as anchor text
A question was asked regarding an “a href” tag that contained anchor text and an image with alt text. Which one helps Google to better understand what the linked page is about? And does the order in which they occur within the tag matter? John replied that the order of these two elements within the tag would not matter. With just an image, it wouldn’t be as valuable as anchor text, but if alt text is associated with the image they would treat that the same as anchor text. It would be converted into text on the page and treated the same.
He did further clarify that this news shouldn’t mean that all visible text should be removed and alt text relied upon. But it should help to know that you’re not losing anything by including both. Other search engines may not see alt text and anchor text as equivalent and for accessibility and usability reasons it may make sense to have visible text there too.
Img Alt Text is Used for Both Web and Image Search
Google treats the text in an image alt attribute as part of the page for web search, as well as information about the image itself, for image search.
Image Alt Text Should Only Describe What’s Shown in the Image
Image alt text should focus on what’s shown in the image and not include other associated keywords which are not relevant to the image.
Use Alt Tags as Anchor Text when Linking with Images
When using links within images, make sure the alt attribute is being used in order to provide the anchor text that you want associated with the link.
Google Uses Alt Attribute as Part of Anchor For Linked Images
For linked images, Google sees the alt attribute as a descriptive part of the page it is on, but it is also used as part of the anchor for the page the image is linking to.
Alt Text Helps Google Understand Pages Beyond Image Search
Text in the alt attribute of images is seen as text on the page and can help Google better understand the page a little bit better beyond image search. However, the text in the alt attribute will likely be somewhere on the page anyway.
Check Alt Text is Present on Mobile Version of Images
John recommends checking that the alt text is present for the mobile version of images for mobile-first indexing. This is something Google has seen missing from sites that serve different content on mobile.
Data-alt Attributes Have No Impact on Image Search or Regular Search
With regard to images, data-alt attributes are used more for lazy-loading and giving other information for images from scripts, but this isn’t used for indexing in any way.
Linked Image Alt Text Acts as Anchor Text
Add alt text to image links as these act as anchor text, including on mobile pages.