How to do image SEO: alt text, file names, formats

From how Google finds an image to alt text, file names, WebP and AVIF, lazy loading, image sitemaps and image traffic in Search Console: the steps in order.

· 12 min readSEO

Short answer

Image SEO starts with adding images the way Google can find them: an img element with a src, not a CSS background. Then come short, in-context alt text for informative images, empty alt text for decoration, a short descriptive file name and a supported format sized for the page. Check the result under the Image search type in Search Console.

Picture this: a shop’s team defines the photos on its category pages as CSS backgrounds in the theme. The page looks perfect, but Google’s image SEO documentation says images given through CSS are not indexed. Alt text and file names no longer matter. So the answer to how to do image SEO follows an order: first Google must find the image, then understand it, then you serve it without slowing the page, and finally you measure.

Product shoots and Merchant Center requirements are not the subject here; for those, see how to prepare product photos. This article covers the page side, which applies to any kind of site.

1. How Google finds an image

Google looks for images in your page’s HTML. The table below summarises which way of adding an image works, based on the documentation and the lazy-loading page.

How you added the image Does Google find it
<img src="..."> Yes. Google finds images in the src attribute of the img element.
<img> inside <picture> Yes. The src is read even when img sits inside another element; if you use picture, write a fallback src.
CSS background-image No. Google does not index CSS images.
Image added later with JavaScript It depends. If the image address shows in the src of an img element in the rendered HTML, the setup works.

So the first job is to search the source for img and src on your important images. An image that only serves as a background or decoration is fine as it is; but every image you want to appear in search must be a real img.

Google also takes an image’s subject from its surroundings. According to the documentation, Google extracts this from the content of the page, including captions and image titles. Place the image near text about its subject, not on a page that has nothing to do with it.

2. Write alt text, and leave it empty when that is right

Google’s documentation says alt text is the most important metadata you can give an image. It helps people who use screen readers or have slow connections; Google uses it, together with computer vision algorithms and the page content, to understand what the image is about. If the image is a link, the alt text also works like anchor text.

The documentation’s own example is a good guide: missing alt text is bad, a keyword pile is bad, a single word like “puppy” is better, and “Dalmatian puppy playing fetch” is best. Stuffing keywords creates a poor user experience and can make the site look like spam.

To decide, the W3C alt decision tree helps. The diagram below is our simplification of that tree into four questions. The tree’s own first question, whether the image contains text, is covered in the table under the diagram.

The alt text decision for one image: four questions, four outcomes Is it a link or a button? Yes Describe where it goes or what it does No Is it a chart or another complex graphic? Yes Give the information as text on the page too No Does it add information to the page? Yes Write a short description of what it shows No Is it decoration, or the same as nearby text? Yes Leave the alt text empty alt="" The alt text decision for one image: four questions, four outcomes Is it a link or a button? Yes Describe where it goes or what it does No Is it a chart or another complex graphic? Yes Give the information as text on the page too No Does it add information to the page? Yes Write a short description of what it shows No Is it decoration, or the same as nearby text? Yes Leave the alt text empty alt=""
Figure: The alt text decision takes four questions: it starts at links and buttons, moves to complex graphics and informative images, and ends with an empty alt for decoration.

To turn the diagram into practice, sort the images on your page into types. The table below lists the rules from the W3C tree by image type; the examples and the short description noted for complex images are ours.

Image type Alt text Example
Image that is a link or button Describes where it goes or what it does “Search” for a magnifying-glass icon
Informative photo or illustration Conveys the information briefly “Oak dining table, side view”
Chart or complex image A short description; the real information also goes on the page as text A table below a sales chart
Image containing text If the text is not elsewhere on the page, put it in the alt text The sentence on a campaign banner
Decoration, or same as nearby text Left empty: alt="" A decorative line beside a heading

Empty alt text is not the same as no alt text. The W3C says to use alt="" for decorative images; if you leave the attribute out entirely, some screen readers read the file name instead. If you have a lot of decoration, also run the checks in what web accessibility is and how to achieve it. For a short definition of the term, see the alt text glossary entry.

3. Make the file name descriptive

The file name gives Google only “very light clues”, but it is a cheap fix. The documentation prefers a short but descriptive name over IMG00023.JPG and asks you to avoid generic names such as image1.jpg, pic.gif and 1.jpg. If you have thousands of images, you may want to automate the naming.

Our pattern: lower case, hyphens between words, no accented characters. For example, oak-dining-table-side.jpg. The documentation says that if you localise your images you should translate the file names too, and mind the URL encoding guidelines if you use non-Latin or special characters. An ASCII name settles this from the start.

If you rename a live image, its address changes and requests to the old address are lost. Redirect the old address to the new one, and with a bulk rename try a single image first (our suggestion). It also matters to link to the same image with the same address everywhere on the site: according to the documentation, that lets Google cache and reuse the image.

4. Set the size, the format and responsive images

Google’s documentation asks you to balance quality and speed: sharp images look more appealing in the result thumbnail and can raise the chance of traffic, but images are often the largest part of a page’s size. The steps:

  1. Choose the format. Google Search supports BMP, GIF, JPEG, PNG, WebP, SVG and AVIF in the src attribute of img. It also recommends that the file extension match the real format.
  2. Compare with your own eyes. Export the same photo as JPEG, WebP and AVIF at the size it will be shown on the page; compare file sizes and fine detail, such as fabric texture, side by side. Your choice comes out of that comparison (our suggestion).
  3. Give a fallback. When you use picture, the documentation asks you to put an img with a src inside it, so a client that does not understand the newer format gets the older file.
  4. Use responsive images. srcset and sizes describe versions of the same image for different screen sizes. The documentation notes that some browsers and crawlers may not understand them, so still write the src.
  5. Write width and height. This is our suggestion: the browser reserves the space before the image arrives and the page does not jump. For speed and layout shift in detail, see how to speed up a website.

If you want a particular image to represent the page in search, you can name your preferred one. According to the documentation, schema.org’s primaryImageOfPage, an image property attached to the main entity, or the og:image meta tag can be used for this. Choose a relevant, representative, high-resolution image; avoid a generic one such as a logo, an image with text in it, and extreme aspect ratios.

<picture>
  <source type="image/avif" srcset="oak-dining-table-side.avif">
  <source type="image/webp" srcset="oak-dining-table-side.webp">
  <img src="oak-dining-table-side.jpg" width="800" height="533"
       alt="Oak dining table, side view">
</picture>

5. Use lazy loading without hiding images from Google

Lazy loading postpones loading an off-screen image until the user gets near it. Google’s lazy-loading page sets two rules. First, your implementation must load content as soon as it is visible in the viewport; because Google Search does not interact with the page, methods that depend on scrolling or clicking hide the image. The browser’s built-in lazy loading, IntersectionObserver and a library that loads on entering the viewport all meet this condition.

Second, do not add lazy loading to content likely to be visible as soon as the page opens; it takes longer to load and the user notices. Our suggestion: never lazy-load the image at the very top of the page, and use the browser’s own feature for the rest.

Checking is easy. Look at the rendered HTML in the URL Inspection tool in Search Console. If your image addresses appear in the src attribute of img elements, the setup works. If they sit only in an attribute such as data-src, suspect that Google cannot see the image (that reading is ours).

6. Submit an image sitemap if you need one

Google describes the image sitemap as a way to tell it about images it might not otherwise find, such as images your site reaches with JavaScript code. You can make a separate file or add image tags to your existing sitemap; according to the documentation, both are equally fine. The required tags are <image:image> and <image:loc>; each <url> can hold up to 1,000 <image:image> tags.

<url>
  <loc>https://www.example.com/product/oak-dining-table/</loc>
  <image:image>
    <image:loc>https://www.example.com/images/oak-dining-table-side.jpg</image:loc>
  </image:image>
</url>

Watch three details. If your images sit on a CDN, the image address may be on another domain. According to the documentation that is fine, as long as you verify both domains in Search Console. Your robots.txt must not block content you want indexed. And the image:caption, image:title, image:geo_location and image:license tags were removed from the documentation, so you do not need to write them. To submit and test the file, the steps in how to prepare robots.txt and a sitemap apply.

7. See image traffic in Search Console

In Search Console’s Performance report, the search type filter separates web, image, video and news searches. The Image type covers traffic from results in the Google Images tab. Searches made with a photo (Google Lens, Circle to Search on Android, uploaded images, Chrome image search) appear separately under “Web: multimodal”.

  1. In Search Console, open Performance, Search results.
  2. From the Search type filter, choose Image.
  3. Widen the date range to a few months and compare with the previous period.
  4. Look at the Queries and Pages tabs: which pages and which queries get image impressions?
  5. Note the date of your changes and look for the effect in the period after it.

If the Image search type shows no data at all, go back to step 1: are your images real img elements?

Common mistakes

  • Giving important images as CSS backgrounds.
  • Leaving alt text empty on informative images, or filling it with a keyword list.
  • Writing long alt text for a decorative image.
  • Writing “image” or “photo” in the alt text; screen readers already say it is an image.
  • Lazy-loading the image at the top of the page.
  • Making the browser download a much larger file just to show a small image.
  • Using srcset and forgetting the src fallback.
  • Renaming a file and not redirecting the old address.

For the speed side, see how to speed up a website; for the rest of the technical audit, see our SEO service.

Common questions

Does alt text directly raise rankings?

The documentation gives no such figure or promise. What it says is that alt text is the most important metadata you can give an image and that Google uses it to understand the image’s subject. It also helps people who use screen readers.

Do I have to write alt text for every image?

No. A decorative image, or one that gives the same information as nearby text, gets empty alt text (alt=""). Images that carry information, or that are links or buttons, need alt text.

Is WebP or AVIF enough, or do I still need JPEG?

Google Search supports both. Even so, Google’s own example gives the newer formats inside picture and leaves an img fallback on the last line. That pattern protects older clients and bots that do not understand srcset.

One thing you can do today: pick the one page that gets, or should get, the most image traffic. Open the rendered HTML in the URL Inspection tool and confirm the images appear in the src of img elements. Then rewrite the alt text and file name of the images on that page using the table above.

Sources

This article is general information, not legal, financial or technical advice. Platforms, their rules and the law change over time, so some details may have changed since 15 November 2026 or contain small errors. Before you make a decision for your business, check the current official sources or write to us.

Tell us about
your project.

Fill in the form or write to us directly, and we will agree on a day to talk.

Your first meeting is with Deniz Sezer, founder of Detmore.

First meeting free · Reply within one working day · Written proposal in 2 to 3 days · NDA ready

What do you need? pick as many as you like

Name, email and phone are required.

Contact

We reply within one working day.