Skip to content
⚙️
Technical SEO
Lesson 10 of 22 · On-Page Optimization
FREE +50 XP

Image SEO and Alt Attributes

Image SEO and alt attributes are three different questions that are usually blended: will Google find the picture, will it understand what is on it, and will the picture slow the page down. Google has a guide for the first two, while speed is covered by web.dev. This lesson covers what is documented, what is only practice, and which checklist rules — including "Latin only in the file name" and "alt up to 125 characters" — do not appear in Google's documentation.

It rests on Google's image SEO best practices guide.

🖼️
A picture without alt
"I am a lovely product photo. But if I was put in through a style background, the search engine will not index me at all."

First: so the picture gets found

An example with a fallback:

<picture>
  <source type="image/avif" srcset="sofa.avif">
  <source type="image/webp" srcset="sofa.webp">
  <img src="sofa.jpg" alt="A grey corner sofa" width="800" height="600">
</picture>

Second: so it is understood what is on the picture

Alt — the key attribute, but not the only source

Google's wording is exact: the most important attribute when it comes to providing more metadata for an image is the alt text, which also improves accessibility for people who can't see images. But Google uses alt text along with computer vision algorithms and the contents of the page to understand the subject matter of the image. When an image is a link, alt text is useful as anchor text.

How to write it: focus on useful, information-rich content that uses keywords appropriately and is in context of the page; avoid filling alt attributes with keywords, as it results in a negative user experience and may cause your site to be seen as spam. The documentation's own examples: missing alt is bad; a string of dozens of words is bad; "puppy" is better; "Dalmatian puppy playing fetch" is best.

Image types: these are W3C rules, not Google's

TypeWhat to put in alt
Informative: a product, a diagram, an illustrationA description of the subject in the page's context
Functional: an image link, an icon buttonThe action or destination, not a description of the icon
DecorativeAn empty alt, so it is skipped
Text in an imagePer the W3C decision tree: if the same text is nearby as real text, an empty alt; if the text has a function, alt conveys it

Note the last row: the old rule "repeat the image's text word for word" does not fit, per the W3C, when the text is already present nearby.

File names: a light clue, and the audience's language

On the file name the guide is restrained: it can give Google very light clues about the subject; when possible use short but descriptive names — my-new-black-kitten.jpg is better than IMG00023.JPG; generic names such as image1.jpg are best avoided. The rule "Latin only", though, the guide contradicts: if you localize your images, remember to also translate the filenames, keeping in mind the URL encoding guidelines if you're using non-Latin or special characters. For a Russian- or Ukrainian-language site that means a Russian or Ukrainian file name is acceptable, and in a link it is encoded — see the lesson on URL structure.

The context around an image

Google extracts information about the subject matter of an image from the content of the page, including captions and image titles; wherever possible make sure images are placed near relevant text and on pages relevant to the image subject matter. The words around a picture work for it just as its alt does. On aligning the words on a page see the lesson on keyword targeting.

Third: what makes a picture noticeable

Fourth: speed and lazy loading

Google's guide reminds us that images are often the largest contributor to overall page size, so modern optimisation and responsive techniques matter. The specific techniques are described on web.dev:

Do not expect guarantees from speed: good results in Core Web Vitals reports don't guarantee a top ranking. More on the metrics in the lesson on Core Web Vitals.

Seeing the result

In the performance report the search type filter separates the traffic: "Image" is traffic from results shown in the Google Images tab, and "Web: multimodal" is search by image, including through Google Lens. That shows whether a site has a flow from images at all before you invest in optimisation. The pages with the most traffic, a place to start, are shown by the pages report, and a page's overall state by page analysis and the site audit.

What is not in Google's documentation

These widespread claims do not appear in the documentation, so they cannot be presented as rules:

  • "Latin only in the file name, three to five words": Google advises translating file names when localising;
  • "alt of 80–125 characters, screen readers cut off anything longer": Google gives no length;
  • "accessibility is a direct ranking factor" and "Google penalises a bad LCP";
  • "images in markup at least 1200 px": for articles the figure named is 50K pixels, width times height;
  • "Google Lens requires a sharp image and structured data";
  • "10–30% of traffic comes from Google Images", target weights (hero up to 100 KB, an icon under 5 KB), AVIF saving 50% and browser support percentages are guidelines and measurements from third-party sources; check them on your own images;
  • the case "LCP from 3.8 to 1.4 s, Images traffic +340%" as proof.

That does not mean the opposite is true. It means the figures are observations, and the reliable basis is what the guide describes.

Checklist

  1. Images embedded as img elements with a src; CSS backgrounds not used for content.
  2. A fallback src for picture and srcset; a format from the supported list.
  3. One address per image across pages; folders not blocked in robots.txt.
  4. Informative alt, in context, with no keyword stuffing; empty for decorative ones.
  5. File names short and descriptive, in the audience's language, with encoding in mind.
  6. The picture placed near relevant text.
  7. Width and height set on every image; the LCP image not lazy-loaded.
  8. For the right page types, structured data with image; for articles, several aspect ratios.
  9. Image traffic read in the performance report by search type.

Mistakes

  • Content images in a CSS background.
  • Alt that is a string of keywords, or identical on every picture.
  • Lazy loading on the main image of the first screen.
  • Images without width and height.
  • Treating Cyrillic in a file name as an error and not translating names when localising.
  • Blocking the image folder in robots.txt.

What comes next

The next lesson is about headings and page content: headings and content.

🎯
Lesson Task
Test your knowledge and earn +25 XP
← Keyword Targeting: Title, H1 and Body Text
Lesson 10 of 22
Go to Task →