Sitemap Index Files Explained
What sitemap index files are, when you need one, how to structure them, and the rules for nesting. Includes syntax examples and organizational strategies.
A single XML sitemap can hold up to 50,000 URLs. That sounds like a lot until you have an e-commerce site with 200,000 products, a news site publishing dozens of articles daily, or a platform with millions of user-generated pages. When one sitemap file isn't enough, you use a sitemap index.
Here's what a sitemap index is, how to structure one, and the rules you need to follow.
What Is a Sitemap Index?
A sitemap index is an XML file that lists other sitemap files. Instead of one massive sitemap containing all your URLs, you split your URLs across multiple sitemaps and then create an index that points to each one.
Think of it like a table of contents for your sitemaps. The search engine reads the index, discovers the individual sitemaps, and then processes each one.
The file typically lives at /sitemap_index.xml or /sitemap-index.xml, though the exact filename doesn't matter as long as search engines can find it (via robots.txt or Search Console submission).
When You Need a Sitemap Index
You need a sitemap index when you hit the limits of a single sitemap file, or when splitting your URLs across multiple files makes organizational sense.
You have more than 50,000 URLs
The Sitemap Protocol limits each sitemap file to 50,000 URLs. If your site has more than that, you must split them across multiple files and use an index.
Your sitemap file exceeds 50MB (uncompressed)
Even if you have fewer than 50,000 URLs, the file can't exceed 50MB uncompressed. Sites with very long URLs or extensive metadata can hit this limit before the URL count limit.
You want to organize sitemaps by content type
Even if you could fit everything in one file, splitting by type (pages, blog posts, products, images) makes your sitemaps easier to manage, debug, and monitor.
Different content updates at different frequencies
Separating frequently-updated content (news, blog) from static content (about pages, legal pages) lets search engines process the dynamic sitemaps more efficiently.
Structure and Syntax
A sitemap index uses the <sitemapindex> root element instead of the <urlset> element used in regular sitemaps. Each child sitemap is listed with a <sitemap> element containing a <loc> tag (required) and an optional <lastmod> tag.
Basic Example
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2025-12-10T08:00:00+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-blog.xml</loc>
<lastmod>2025-12-18T14:30:00+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
<lastmod>2025-12-19T09:15:00+00:00</lastmod>
</sitemap>
</sitemapindex>
Each <loc> points to a complete sitemap file that follows the standard sitemap protocol with <urlset> as its root element.
With Numbered Sitemaps
For very large sites, sitemaps are often numbered:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-products-1.xml</loc>
<lastmod>2025-12-19T09:15:00+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products-2.xml</loc>
<lastmod>2025-12-19T09:15:00+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products-3.xml</loc>
<lastmod>2025-12-18T11:00:00+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products-4.xml</loc>
<lastmod>2025-12-15T16:45:00+00:00</lastmod>
</sitemap>
</sitemapindex>
With 50,000 URLs per file, four product sitemaps can hold up to 200,000 product URLs.
The Nesting Rule: No Nested Indexes
This is the most important rule to know: a sitemap index cannot reference another sitemap index. The Sitemap Protocol explicitly forbids nesting.
<!-- This is INVALID -->
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-index-products.xml</loc> <!-- Another index - NOT ALLOWED -->
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-index-blog.xml</loc> <!-- Another index - NOT ALLOWED -->
</sitemap>
</sitemapindex>
Your sitemap index must point directly to sitemap files containing <urlset> elements with actual URLs. One level of indirection only.
What if you have millions of URLs?
A single sitemap index can list up to 50,000 sitemaps. Each sitemap can contain 50,000 URLs. That gives you a theoretical maximum of 2.5 billion URLs from a single sitemap index. If your site exceeds this, you can submit multiple sitemap indexes through Search Console or reference multiple indexes in your robots.txt.
Organizing Sitemaps by Content Type
The most common organizational strategy is splitting sitemaps by content type. This approach has practical benefits beyond just managing URL counts.
A Typical Organization
| Sitemap File | Contents | Update Frequency |
|---|---|---|
| sitemap-pages.xml | Static pages (home, about, contact, legal) | Monthly or less |
| sitemap-blog.xml | Blog posts and articles | Weekly or as published |
| sitemap-products.xml | Product pages | As inventory changes |
| sitemap-categories.xml | Category and collection pages | When structure changes |
| sitemap-images.xml | Image sitemap entries | As media is added |
Why This Organization Matters
Debugging: When Search Console reports errors in sitemap-products.xml, you know exactly where to look. Errors in a single monolithic sitemap are harder to trace.
Monitoring: You can track indexing rates by content type. If your product pages have a 40% indexing rate while your blog posts have 90%, that's actionable information that's only visible when sitemaps are split by type.
Performance: Search engines can process smaller sitemaps faster. A 5,000-URL sitemap processes more quickly than a 50,000-URL sitemap, which means changes are discovered sooner.
Selective updates: When you publish a new blog post, only sitemap-blog.xml needs to be regenerated and its lastmod updated. The other sitemaps stay unchanged, and search engines can skip re-processing them.
Monitor all your sitemaps in one place
Track indexing across multiple sitemaps, catch errors early, and know exactly which content types are performing.
Lastmod on Index Entries
The <lastmod> date on a sitemap index entry should reflect when the referenced sitemap file was last modified. This tells search engines which sitemaps have changed since the last crawl.
<sitemap>
<loc>https://example.com/sitemap-blog.xml</loc>
<lastmod>2025-12-19T14:30:00+00:00</lastmod>
</sitemap>
When Google reads your sitemap index, it checks the <lastmod> dates. If a sitemap's lastmod hasn't changed since Google last processed it, Google may skip re-fetching that file entirely. This is efficient for both you and Google.
The same accuracy rules apply: Only update the lastmod on a sitemap index entry when the referenced sitemap's contents have actually changed. If you regenerate the sitemap but no URLs were added, removed, or modified, don't bump the date.
Gzip Compression
Sitemap files (both individual sitemaps and sitemap indexes) can be served gzip-compressed. This is particularly useful for large sitemaps.
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-products.xml.gz</loc>
<lastmod>2025-12-19T09:15:00+00:00</lastmod>
</sitemap>
</sitemapindex>
Compression typically reduces sitemap file size by 70-80%. A 10MB sitemap compresses to about 2MB. All major search engines support gzip-compressed sitemaps.
Compress large sitemaps
If any of your sitemap files exceeds a few megabytes, serve them gzip-compressed. It reduces bandwidth for both your server and the search engine crawler. Just make sure your web server is configured to serve .xml.gz files with the correct Content-Type: application/xml and Content-Encoding: gzip headers.
Building a Sitemap Index: Step by Step
Decide how to split your URLs
Group URLs by content type, language, or simply by count (batches of 50,000). Content type is usually the most useful split for monitoring and debugging.
Generate individual sitemap files
Create a valid XML sitemap for each group. Each file should have a <urlset> root element and contain no more than 50,000 URLs.
Create the sitemap index file
Create an XML file with <sitemapindex> as the root element. Add a <sitemap> entry for each individual sitemap, including the full URL in <loc> and the last modification date in <lastmod>.
Upload and verify access
Upload all files to your web server. Verify each sitemap URL returns a 200 status with valid XML. Verify the sitemap index itself is accessible and parseable.
Reference in robots.txt and submit to Search Console
Add Sitemap: https://yourdomain.com/sitemap-index.xml to your robots.txt. Submit the same URL in Google Search Console and Bing Webmaster Tools. You only need to submit the index -- search engines will discover the individual sitemaps from it.
Common Pitfalls
Forgetting to update the index when adding a new sitemap. If you add a new content type and create sitemap-videos.xml, you need to add it to your sitemap index too. Otherwise, search engines won't discover it through the index.
Stale lastmod dates on the index. If you update sitemap-blog.xml but don't update the corresponding <lastmod> in the index, search engines may not re-fetch the updated sitemap promptly.
Exceeding the 50,000 sitemap limit in the index. This is rare but possible for extremely large sites. If you hit this limit, submit multiple sitemap indexes through Search Console.
Inconsistent URL formats. If your sitemaps use https://www.example.com/... but your sitemap index references https://example.com/sitemap-blog.xml (without www), the mismatch can cause issues. Keep the domain format consistent.
Including empty sitemaps in the index. If a sitemap has zero URLs (perhaps a content type you haven't populated yet), don't include it in the index. Empty sitemaps are technically valid but serve no purpose and can generate warnings in Search Console.
Related Articles
One index to reference them all. Split by content type, keep lastmod accurate, and never nest indexes.
Validate your XML sitemap
Check your sitemap for errors, broken URLs, and indexing issues. Free instant validation.