How to Configure an Image Sitemap (Image XML Sitemap)
Images can drive meaningful organic traffic through Google Images and visual search features. However, search engines don’t always discover and interpret images perfectly—especially when images are lazy-loaded, embedded in galleries, or injected via JavaScript. An image sitemap helps Google find your images faster and associate them with the pages where they belong.
What an image sitemap is and why it matters
An image sitemap is an XML file (or an extension of your main sitemap) that lists page URLs and the images used on those pages. It’s particularly helpful if:
-
you publish lots of image-heavy content (e-commerce, portfolios, media);
-
images are loaded dynamically (lazy-load, JS galleries);
-
you want faster indexing of new images and better image visibility.
Pre-checks before you build the sitemap
-
Images must be crawlable: not blocked by robots.txt and not behind authentication.
-
Image URLs should return 200 OK (avoid redirect chains).
-
Reduce duplicates: don’t expose the same image under many URLs (params, resize endpoints, multiple CDN variants).
-
Use proper quality and sizes for important images.
-
Provide context: alt text and relevant page content still matter.
Separate image sitemap vs embedding into the main sitemap
-
A separate image-sitemap.xml is cleaner for large sites.
-
Embedding images into the main sitemap can be fine for smaller projects.
For larger sites, use a sitemap index and split files by content type and volume.
XML structure: how images are listed
The common pattern is: each points to a page, and inside you include one or more entries pointing to image URLs. Optional metadata (title/caption) can help, but correctness and crawlability are key.
Tip: avoid listing decorative assets (icons, backgrounds). Focus on images that can rank or add value—product photos, featured images, portfolio items, infographics.
How to generate an image sitemap
CMS-based websites
Many SEO plugins can generate sitemaps. Ensure your solution actually includes images for posts/products and not only page URLs.
Custom sites / frameworks
A robust approach is to generate XML on a schedule:
-
fetch pages (posts/products);
-
fetch related images from your database or storage mapping;
-
output sitemap files into your public directory;
-
for scale, split into multiple files and create a sitemap index.
Submitting: robots.txt and Google Search Console
After publishing the file:
-
Add sitemap references to robots.txt using
Sitemap:lines. -
Submit the sitemap in Google Search Console and monitor processing status.
Common issues that prevent indexing
-
Images or folders blocked in robots.txt.
-
Image URLs that redirect or require cookies/auth.
-
Duplicate image URLs from resizing endpoints or query parameters.
-
Unreliable CDN responses (timeouts/403).
-
Too many non-essential images inflating the sitemap.
How to verify it’s working
Monitor:
-
sitemap processing status in Search Console;
-
indexed image counts over time;
-
impressions/clicks from Google Images;
-
how quickly newly published images appear in search.