Image sitemaps explained

How to tell Google about the images on your pages so they can surface in Google Images.

An image sitemap tells search engines about the images on your pages. Crawlers do not always find images loaded by JavaScript, served from a separate domain, or referenced only in CSS — listing them explicitly gives those images a fair chance of appearing in image search.

How it works

Rather than a separate file, image information is added inside a normal XML sitemap using the image namespace. Each page entry can list the images that appear on it:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  <url>
    <loc>https://example.com/gallery</loc>
    <image:image>
      <image:loc>https://example.com/img/harbour.jpg</image:loc>
    </image:image>
  </url>
</urlset>

Only the image's location is required. Each page may list up to 1,000 images, and the images can live on a different domain from the page as long as you are allowed to reference them.

When it helps

  • Galleries and portfolios where images are the main content.
  • Product photos on an online store.
  • Images served from a CDN on a separate hostname.
  • Images lazy-loaded or injected by JavaScript that a crawler might skip.

Descriptive alt text still matters

An image sitemap helps discovery, but it does not replace good alt text, descriptive file names and surrounding page content — those are what help an image rank for the right searches.