Your best product photo can be live on your site and still be hard for Google to find. An image sitemap gives Google a direct list of important images and the pages where they appear.

That helps with discovery, especially when images load through JavaScript or sit on a separate CDN. It doesn’t guarantee that Google will index them or show them in Google Images. We start by choosing the right pages, then build a clean file and check that Google can reach every image in it.

What an image sitemap can and cannot do

A standard XML sitemap lists page URLs. An image sitemap adds image URLs beneath those page entries. Think of each page as a folder and its image records as the contents Google should look for.

Five image tiles flow toward a single document icon on a dark grid.

Google’s image sitemap documentation says this format helps it discover images it might otherwise miss. We find it most useful for sites with large image collections, frequently updated products, or images that aren’t easy to find through ordinary page crawling.

Discovery is the realistic goal. Google still has to fetch the page and image, assess them, and decide what belongs in its index. A sitemap alone won’t fix blocked files, weak pages, or poor image context.

Step 1: Choose the pages and images worth listing

Before we create XML, we make a small inventory. Which pages do you want people to find, and which images genuinely help those pages?

Start with the preferred page URLs

Use the canonical, indexable version of each page. If a product has several URLs because of filters or tracking parameters, list the preferred product page rather than every variation. Keep redirects, broken pages, thin archives, and old test content out of the file.

The same principle applies to your broader sitemap. Our XML sitemap guide explains how to keep the main page list focused. An image extension works best when the pages underneath it are clean too.

Match images to their real pages

Add each useful image under a page where that image appears. A service page might have a project photo; a product page might have several product views. Don’t treat the sitemap as storage for every old file in your media library.

Check the live page before adding an image. If a file was removed, replaced, or never appears in meaningful page content, leave it out. That keeps the list useful as the site changes.

Step 2: Build the image sitemap XML

You can add image entries to an existing XML sitemap or put them in a separate image-focused sitemap. Either way, the structure is the same: a page entry contains its page URL and one or more image entries.

Set up the XML wrapper

Save the file as UTF-8 XML. Begin with <?xml version="1.0" encoding="UTF-8"?>. Then open the root element with both the standard sitemap namespace and Google’s image namespace:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">

That second namespace is what makes the image: tags meaningful. Close the file with </urlset> after all page entries. Without the proper wrapper, a file that looks readable to us may still fail XML validation.

Add a page and its image records

Inside <url>, the ordinary <loc> holds the page URL. Each <image:image> contains an <image:loc> with the image file URL. For example:

<url><loc>https://www.example.com/gallery</loc><image:image><image:loc>https://www.example.com/images/gallery.jpg</image:loc></image:image></url>

That example is one complete page entry. For another image on the same page, add another <image:image> block before </url>. For another page, start a new <url> entry. If a URL contains an ampersand in the XML, escape it as &amp; so the file stays valid.

Step 3: Check every image URL before publishing

A neat XML file won’t help if the image addresses lead to errors. We test the URLs themselves, not only the pages that use them.

Use complete, stable image addresses

Each <image:loc> needs an absolute URL, such as https://www.example.com/images/gallery.jpg, rather than a relative path like /images/gallery.jpg. Point to the image file, not the page that displays it.

Open a sample of image URLs in a browser and check the HTTP response. An image intended for discovery should load without a login, return successfully, and stay at a stable address. Watch for expired signed links, missing files, redirect chains, and CDN rules that treat crawlers differently from visitors.

Check access across domains

Your images can live on a different domain from your pages. That’s common when a CDN serves product photos. Google’s image sitemap guidance says to verify both domains in Search Console when needed.

Then check robots.txt for the image host. A rule that blocks the relevant image directory can stop Google from fetching files even though their URLs appear in the sitemap. Also review indexing controls on media responses. Our guide to X-Robots-Tag for images and other media covers the headers to check when an accessible file still isn’t eligible for indexing.

Step 4: Keep the sitemap within Google’s limits

There are two limits to remember, and they apply to different parts of the file. Google allows up to 1,000 image entries within one page’s <url> element. That isn’t a limit of 1,000 images for the whole sitemap.

A single sitemap file can contain at most 50,000 page URLs or 50 MB uncompressed, whichever limit you reach first. Google’s sitemap size guidance applies to image-enabled sitemaps too. Image entries add file size even though they sit inside page entries.

What if your file grows past either file limit? Split it into smaller sitemaps and list those files in a sitemap index. Don’t force a large catalog into one file. We also check that automated exports aren’t repeating the same page URL because a filter or tracking parameter changed.

Step 5: Publish and submit the file

Once the XML and URLs check out, put the sitemap at a stable, publicly accessible address. The site root is an easy place to manage one, for example, https://www.example.com/image-sitemap.xml. Open that address yourself and confirm it returns the XML file rather than a login page or an error.

Reference it in robots.txt

Add a Sitemap: directive to the site’s robots.txt, using the full sitemap URL. For the example above, the line would be Sitemap: https://www.example.com/image-sitemap.xml.

This tells crawlers where to find the file. Check that robots.txt doesn’t also block the sitemap, the listed pages, or the image files you want Google to access.

Submit it in Google Search Console

First, verify the appropriate site property. Then open Sitemaps in Google Search Console and submit the sitemap address. If you use a sitemap index, submit the index so Google can find its child files.

Afterward, check the report for fetch or processing errors. Our Search Console Sitemaps report guide explains what the submission status tells you. A successful status means Google could read the file; it doesn’t mean every listed image has been indexed.

Step 6: Validate and troubleshoot the result

We check three things separately: whether the XML is valid, whether the URLs work, and whether Google can process the sitemap. That makes errors much easier to fix.

A magnifying glass examines an XML document beside a panel with check and alert icons.

Test the file and a sample of URLs

Run the file through an XML validator, then inspect its structure. The root must declare the image namespace. Each image needs its own <image:image> wrapper and an <image:loc> pointing to the file. Each parent <url> needs a page <loc>.

Next, test pages and image URLs directly. If a page redirects to a different canonical URL, update the sitemap entry. If an image returns a 403 or 404 response, fix access or remove the entry. For a large file, sample URLs from several templates rather than checking only the first page.

Separate discovery problems from indexing problems

If Search Console can’t fetch the sitemap, check its address, server response, XML syntax, and crawl access first. If the sitemap succeeds but an important page doesn’t appear in search, use URL Inspection to review that page. Check its canonical URL, indexing settings, and crawl status.

An image needs context beyond its XML entry. Google’s image SEO best practices also cover descriptive page content, image elements in HTML, and image quality. We wouldn’t expect a sitemap submission to make up for a page Google can’t properly read.

Keep the file current without chasing old advice

Update image entries when important pages gain, lose, or replace images. If your sitemap generator adds <lastmod>, use it for genuine page updates rather than changing every date on every export.

You’ll also find older image sitemap examples that recommend <image:caption>, <image:title>, <image:geo_location>, or <image:license>. Those fields aren’t part of Google’s current image sitemap instructions. Start with the supported <image:image> and <image:loc> tags instead. Likewise, don’t spend time tuning old sitemap priority or changefreq values for Google.

The simplest maintenance check is practical: does the sitemap still list the preferred pages, and can Google still fetch their images? A clean file is easier to troubleshoot than an oversized inventory that nobody reviews.

Key Takeaways

  • Put image file URLs inside the entries for their relevant, canonical pages.
  • Use Google’s image namespace, valid XML, and absolute URLs that remain crawlable.
  • Respect the 1,000-images-per-page limit and the sitemap’s 50,000-URL or 50-MB file limits.
  • Submit the file, check its status, and investigate page or image access separately when results fall short.

Give Google a clear path to your images

A useful image sitemap starts with a simple pairing: the right image beneath the right page. Build that structure, publish a file Google can read, and keep the URLs current.

If a valuable photo is still hard to find, check access and page context before adding more XML. Better discovery begins with a clear path, but Google still decides what to index and rank.

We use cookies so you can have a great experience on our website. View more
Cookies settings
Accept
Decline
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active

Who we are

Our website address is: https://nkyseo.com.

Comments

When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection. An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.

Media

If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.

Cookies

If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year. If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser. When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed. If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.

Embedded content from other websites

Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website. These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.

Who we share your data with

If you request a password reset, your IP address will be included in the reset email.

How long we retain your data

If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue. For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.

What rights you have over your data

If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.

Where your data is sent

Visitor comments may be checked through an automated spam detection service.
Save settings
Cookies settings