BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
SEO

Image sitemap: When to use one and how to write it

An image sitemap lists the images on each of your pages, so Google can find the ones it might miss, such as images added by JavaScript or hosted on a CDN.

Monthly searches · image sitemap
1.0k
Keyword research data
image sitemap
Image sitemap: When to use one and how to write it
Click the image to view it full size

An image sitemap is a sitemap that also lists the images on each page. Under each page's address you add one entry per image, using a small extension to the normal sitemap format. You can keep it as a separate file or add the image tags to the sitemap you already have; Google treats both the same.

Do you need one?

Our advice: usually not. Google describes image sitemaps as a way to point out images it might not otherwise find, and it finds images in the src of ordinary <img> elements when it crawls your pages. So if your images are plain <img> tags on pages Google can reach, they rarely need help.

An image sitemap earns its place when Google might miss images:

  • Images added by JavaScript, such as galleries, sliders or product viewers that build their markup in the browser.
  • Images hosted on another domain, such as a content delivery network. Unlike the page URLs in a regular sitemap, the image URLs may point to other domains.

On a large catalog where image search brings customers, it's also a cheap way to make sure every product photo is tied to its page.

A sitemap is a hint, not an order. It helps Google discover images; it doesn't guarantee they get indexed or shown.

What an image sitemap looks like

Here is a page entry with two images, written into a regular sitemap:

<?xml version="1.0" encoding="UTF-8"?>
<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/shoes/trail-runner</loc>
    <image:image>
      <image:loc>https://example.com/img/trail-runner-side.jpg</image:loc>
    </image:image>
    <image:image>
      <image:loc>https://cdn.example.net/img/trail-runner-sole.jpg</image:loc>
    </image:image>
  </url>
</urlset>

Only two tags are needed:

  • <image:image> wraps one image. Each page (<url>) can hold up to 1,000 of them.
  • <image:loc> is the image's full URL.

The xmlns:image line at the top declares the image namespace; without it, the tags aren't valid.

Tags you can drop

Older guides and plugins still write <image:caption>, <image:title>, <image:geo_location> and <image:license>. Google stopped using them on August 6, 2022. Leaving them in does no harm, but they do nothing. Google Search Central

What they used to carry now lives elsewhere: describe images with alt text and captions on the page, and give license details through image license structured data or IPTC photo metadata. Image SEO covers both.

Rules that come from regular sitemaps

An image sitemap is still a sitemap, so the usual rules apply:

  • One file holds at most 50,000 URLs or 50 MB uncompressed. Split larger sitemaps and list the parts in a sitemap index file.
  • Save the file as UTF-8 and use full, absolute URLs.
  • Put it at the root of your site, so it can cover every page.
  • Google ignores <priority> and <changefreq>, so don't spend time on them.

Submit it and check it

Tell Google where the file is in one of two ways:

  1. Submit it in the Sitemaps report of Google Search Console. That also shows when Google last read it and any errors it found.
  2. Add a line to your robots.txt file, such as Sitemap: https://example.com/sitemap-images.xml.

If your images live on another domain, verify that domain in Search Console as well as your own. And check that robots.txt on that domain doesn't block the image files: Google can't index an image it isn't allowed to fetch.

Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.