Skip to content
Enjoy 20% off for 12 months on all plans. Use promo code: HYPERGROWTHClaim it

Image Sitemap XML: How to Build One Google Will Actually Read

By Toy Wen Da, Co-Founder · Updated · 7 min read · scored 90/100

An image sitemap xml file is a sitemap, or an extension to one, that lists the images on your pages so Google can find and index them. It also covers images loaded with JavaScript, which a normal crawl might miss. Start by checking whether your current sitemap already includes image tags, because many platform-generated sitemaps skip them entirely.

Minimalist image of HTML keycaps against a gray background, perfect for digital and web design themes.

What an image sitemap xml looks like

Google's documentation describes two valid approaches: a standalone image sitemap, or image tags added to your regular sitemap. Google's crawler treats them the same, so the choice is structural and has no ranking effect.

Here's the shape of it, based on Google Search Central's documentation:

<?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/sample1.html</loc>
    <image:image>
      <image:loc>https://example.com/image.jpg</image:loc>
    </image:image>
    <image:image>
      <image:loc>https://example.com/photo.jpg</image:loc>
    </image:image>
  </url>
  <url>
    <loc>https://example.com/sample2.html</loc>
    <image:image>
      <image:loc>https://example.com/picture.jpg</image:loc>
    </image:image>
  </url>
</urlset>

The only two tags you need

Google requires just two tags inside each image:image block:

Tag Purpose Required?
image:image Wraps the data for one image Yes
image:loc The image's full URL Yes
image:caption Deprecated by Google No, ignored
image:title Deprecated by Google No, ignored
image:geo_location Deprecated by Google No, ignored
image:license Deprecated by Google No, ignored

Older tutorials still tell you to add captions and titles. Google removed them from its documentation, so including them does no harm and no good. Leave them out and keep the file lean.

Each url element can hold up to 1,000 image:image tags. A product page with a handful of photos never comes close, but a gallery page with thousands of images might need to be split across several url entries or several sitemap files.

Flat illustration of simple shapes and icons

Fixing it inside your own website

Flat illustration of simple shapes and icons

How you fix a missing or broken image sitemap xml depends on your platform, so here is the path for the most common setups.

WordPress

With Yoast SEO or a similar plugin, images are usually added to the sitemap automatically once the plugin's XML Sitemaps setting is on. Look under the plugin's General or Features settings for the toggle. If you built your sitemap manually or with a bare-bones plugin, you'll likely need a dedicated image sitemap extension, since the default WordPress sitemap doesn't include image tags. If you aren't sure what your current sitemap contains, this guide to how to find, read, and fix your wp-sitemap.xml walks through it.

Shopify

Shopify's native sitemap doesn't include image tags, which is why third-party apps exist for the job. Easy Image Sitemap, for example, is listed from $5.12 SGD/month (roughly $4 USD) for stores with around 400 images, rising to $52.71 SGD/month for catalogs of 20,000 images, per the app's published Shopify pricing. It builds the file, submits it to Search Console and monitors indexing over time. Reviewers on the Shopify App Store give it a 4.9 out of 5 average across 29 reviews. Several merchants credit it for fixing images that were submitted but showed zero indexing, a common symptom when images sit on a CDN domain Google hasn't fully verified.

Custom-built or static sites

If your site is hand-coded or statically generated, you'll either generate the XML programmatically at build time or use a sitemap generator that supports the image namespace. A general-purpose crawler that outputs a standard sitemap is a good starting point, and you can run one with the free XML Sitemap Generator. Then add image tags by hand or with a script if the generator doesn't support them natively.

After you edit the file

Whichever route you take, finish with these steps:

  1. Confirm the file validates as XML (no unclosed tags, correct namespace declaration).
  2. Upload it to your site's root or wherever your other sitemaps live.
  3. Check that robots.txt doesn't block the image URLs or the folder they sit in.
  4. If images are hosted on a different domain (a CDN, for instance), verify that domain separately in Google Search Console.
  5. Resubmit the sitemap under Sitemaps in Search Console.

When your own tools are enough, and when they aren't

A black and white image of wrenches neatly hanging on a workshop wall.

A free checker or a one-time manual fix is enough when you're troubleshooting a single URL or confirming a sitemap is valid after a one-off edit. It stops being enough on an image-heavy catalog that changes weekly, because someone or something has to keep the sitemap current every time you add a product or a blog post.

Situation Free/manual route enough? Why
Checking one page's image tags are present Yes A single lookup, no ongoing maintenance needed
Validating a sitemap after a one-time fix Yes Static check, nothing to automate
A 50-page brochure site with rare image updates Yes Low volume, infrequent changes
A Shopify store adding products weekly Usually not Needs automatic resubmission on every change
A media site publishing dozens of images daily Usually not Manual regeneration can't keep pace
Diagnosing why specific images show "submitted, not indexed" Start free, escalate if unresolved Monitoring over time catches patterns a snapshot can't

If you're only confirming a fix worked, the Sitemap Checker will tell you in seconds. If you manage hundreds of SKUs with new images every day, you want a tool that regenerates and resubmits the sitemap automatically, and that is the gap apps and plugins exist to fill.

Common mistakes

  • Assuming your platform's default sitemap includes images. Most don't unless a plugin or app adds image tags.
  • Blocking the image folder in robots.txt while still listing those images in the sitemap. Google can't index what it's told not to crawl.
  • Forgetting to verify the CDN domain in Search Console when images are hosted separately from the main site.
  • Adding deprecated tags like image:caption or image:license in the hope of better rankings. Google ignores them.
  • Treating the sitemap as "set and forget" on a catalog that changes constantly, then wondering why new product images never get indexed.
  • Skipping Search Console's sitemap report after submission, even though it is often the only place a parsing error shows up.

FAQs

Do I need a separate image sitemap, or can I add images to my existing one?

Either works. Google treats a standalone image sitemap and image tags added to your regular sitemap as equally valid, so pick whichever your platform generates more easily.

Why are my images submitted but not indexed?

This often happens when images are hosted on a separate domain, like a CDN, that hasn't been verified in Google Search Console. It can also happen if robots.txt blocks the image path, or if the images are low-quality, duplicated elsewhere or simply not valuable enough for Google to prioritize.

How many images can one sitemap entry include?

Up to 1,000 image:image tags per url element, per Google's documentation. Pages with more images than that typically need their listings split across multiple sitemap files.

Does an image sitemap xml improve my Google ranking?

Not directly. It improves the odds that Google finds and indexes your images, especially ones loaded via JavaScript that a standard crawl might miss. Ranking in image search still depends on relevance, image quality and the content around the image.

Can I use a plugin instead of writing the XML myself?

Yes, and for larger or frequently updated catalogs it's usually the practical choice. WordPress plugins like Yoast SEO can generate sitemaps automatically, and Shopify apps such as Easy Image Sitemap build, submit and monitor the file on an ongoing basis.

Check your image sitemap today

Run your current sitemap through the free Sitemap Checker and see whether image tags are present and valid. If they're missing, the platform fix above that matches your setup is your next step. Once the file is live, watch indexing status in Search Console over the following weeks, since that is where image sitemap xml problems actually show up. If you want a fuller picture of what else might be holding your pages back in search, talk to the team.

See what this looks like on your own siteEnter your website. You get the searches your buyers make and the page that should answer each one.

Sources

About the author

SearchBlueprint researched, wrote and scored this article with the content pipeline our customers run on their own sites. The score in the byline is what our content engine gave this page before it published. Nothing here is reviewed by hand, which is the point: it is the product's output, published where anyone can check it.