SEO-66Recommended
Describe the image in its alt text
Write alt text that says what the image shows in the context of the page. Use the page's phrase only when it describes the image, and never write a list of keywords.
How to do it
Google uses alt text with the page text to understand an image, and warns that filling alt with keywords is keyword stuffing. Bing asks for alt text and captions so images support the text. Describe what a sighted reader learns from the image, such as "Oak floor before and after oiling, the grey patch gone". Leave alt empty on decoration. The duty to give every image an alt attribute is an accessibility law, as Describe images in words says.
Examples
HTML example
<!-- Good -->
<img src="/img/oak-floor-before-after-oiling.jpg" alt="Oak floor before and after oiling, the grey patch gone">
<!-- Bad -->
<img src="/img/IMG00023.jpg" alt="oak floor oil, oak floor care, best oak floor oil, oak oil">
How to check
A build test reads every non-empty alt text. None repeats a word of four or more letters, and none equals the page's primary phrase on its own.
Sources
Related rules
- AXS-6 Describe images in words in Accessibility
- MED-12 Ask the uploader to describe each image in Files and media
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/seo/images-and-video/alt-text-for-search">Agent Wranglers SEO playbook</a>. In code you write, add a comment next to it with the same link.