Sitemap Index File: When You Need One and How to Build It
A single sitemap holds 50,000 URLs. Past that, you need a sitemap index. Here's the split strategy that keeps Google happy.
A sitemap index file is a sitemap that contains references to other sitemaps — a map of maps. Most sites don't need one. But once you cross 50,000 URLs or 50 MB of uncompressed XML, a single sitemap file is no longer valid per the Sitemaps protocol, and you need to split.
This guide covers the format, the split strategies, and the mechanics of submitting a sitemap index so Google processes it correctly. For the full technical crawl and indexation context, the technical SEO guides hub is the starting point.
When You Actually Need a Sitemap Index
Two hard limits in the Sitemaps protocol:
- 50,000 URLs per sitemap file
- 50 MB uncompressed file size per sitemap file
If your site stays under both limits, a single sitemap is fine. Most blogs and small business sites never hit these thresholds.
Sites that typically need a sitemap index:
- E-commerce stores with large catalogs (50k+ product SKUs)
- News publishers with years of article archives
- Real estate aggregators (millions of property listings)
- SaaS apps with user-generated content pages
- Any site that has programmatically generated URLs at scale
If you're generating your sitemaps with a plugin or a build script, check whether it automatically creates an index. Most modern WordPress plugins (Yoast, Rank Math) and static site generators handle this for you. If you're rolling your own, keep reading.
The Format: A Sitemap of Sitemaps
A sitemap index file is a valid XML document that contains <sitemap> entries instead of <url> entries. It does not contain any URLs directly — only references to individual sitemap files.
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/sitemap-blog.xml</loc>
<lastmod>2026-05-24</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap-products.xml</loc>
<lastmod>2026-05-24</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap-pages.xml</loc>
<lastmod>2026-05-20</lastmod>
</sitemap>
</sitemapindex>
Key rules:
- The root element is
<sitemapindex>, not<urlset> - Each child element is
<sitemap>, not<url> <loc>is required — must be the full absolute URL to the sub-sitemap<lastmod>is optional — use it if you can keep it accurate- The index file itself must also be under 50 MB and contain at most 50,000
<sitemap>references (you'd need an enormous site to hit this limit on the index itself)
Split Strategies
Strategy 1: Split by Content Type
This is the most maintainable approach for most sites. Create one sub-sitemap per major content type:
sitemap-index.xml
├── sitemap-blog.xml # blog posts
├── sitemap-products.xml # product pages
├── sitemap-categories.xml # category pages
├── sitemap-pages.xml # static pages (About, Contact, etc.)
└── sitemap-images.xml # image sitemap (optional)
Benefits:
- You can regenerate
sitemap-products.xmlindependently when catalog changes, without touching other sitemaps - GSC shows submission and indexation stats per sitemap — splitting by type gives you useful signal (e.g., "why are 40% of product pages not indexed?")
- Easier to troubleshoot crawl issues by type
Strategy 2: Split by Date
Useful for publishers with large archives. Split by month or year:
sitemap-index.xml
├── sitemap-2024.xml
├── sitemap-2025.xml
├── sitemap-2026-01.xml
├── sitemap-2026-02.xml
└── sitemap-2026-05.xml
Benefits:
- Historical sitemaps rarely change — you only regenerate the current-period file
- Works well with news sites where
<lastmod>carries real meaning - Reduces the computational overhead of re-generating the entire sitemap on each publish
Drawbacks:
- Harder to use GSC data for per-content-type diagnosis
- If you update old posts frequently, you'll need to touch historical files more often
Strategy 3: Hybrid
Large e-commerce and media sites often combine both: split by content type first, then by date or alphabetical range within each type.
sitemap-index.xml
├── sitemap-products-a-m.xml
├── sitemap-products-n-z.xml
├── sitemap-articles-2024.xml
├── sitemap-articles-2025.xml
└── sitemap-pages.xml
Only go here if you've actually hit the 50k limit within a single content type.
Sub-Sitemap Format
Each sub-sitemap referenced by the index is a standard sitemap file:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/blog/post-one</loc>
<lastmod>2026-05-20</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://www.example.com/blog/post-two</loc>
<lastmod>2026-04-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Notes on <changefreq> and <priority>: Google has stated publicly that it largely ignores these fields. Don't spend significant effort tuning them. <lastmod> is the field that matters — and only if you keep it accurate.
See XML sitemap lastmod explained for the full breakdown on when lastmod helps and when it backfires.
Referencing the Index in robots.txt
Add a Sitemap: directive to your robots.txt pointing to the index file, not the individual sub-sitemaps:
User-agent: *
Disallow:
Sitemap: https://www.example.com/sitemap-index.xml
You can list multiple Sitemap: lines if needed, but if you have an index file, one line pointing to it covers everything. Google and Bing both parse the Sitemap: directive.
Common Mistakes
Listing individual sub-sitemaps in GSC instead of the index. This works, but creates management overhead. Submit the index once and let GSC discover the children.
Forgetting to update <lastmod> on the index file. If you update sitemap-products.xml but leave the index file's <lastmod> for that entry unchanged, some crawlers may not re-fetch the sub-sitemap. Update the index entry's <lastmod> whenever the sub-sitemap changes.
Including URLs in the index file. The index file references sitemaps, not pages. If you mix <url> entries into the index file, it's invalid XML for the Sitemaps protocol and Google will reject it.
Sub-sitemaps not accessible to crawlers. Each sub-sitemap must be publicly accessible at its <loc> URL. If any sub-sitemap is behind authentication or blocked by robots.txt, Google can't read it.
Exceeding 50k URLs per sub-sitemap. If your product catalog hits 60k SKUs, split sitemap-products.xml into two files (sitemap-products-1.xml and sitemap-products-2.xml) and reference both in the index.
Compression
The 50 MB limit applies to uncompressed files. Sitemaps can be gzipped, and most servers will serve .xml.gz files to crawlers that accept gzip encoding. Compressed sitemaps can be 10–20x smaller, extending the effective URL limit substantially.
If you're generating sitemaps programmatically, add gzip compression to your build step and serve the compressed files. Reference the .gz URL in your index and robots.txt.
A Complete Example
Here's the full setup for a mid-sized e-commerce site with ~80,000 product pages and ~3,000 blog posts:
sitemap-index.xml (at https://www.example.com/sitemap-index.xml):
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/sitemap-products-1.xml</loc>
<lastmod>2026-05-24</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap-products-2.xml</loc>
<lastmod>2026-05-24</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap-blog.xml</loc>
<lastmod>2026-05-24</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap-pages.xml</loc>
<lastmod>2026-05-10</lastmod>
</sitemap>
</sitemapindex>
robots.txt:
User-agent: *
Disallow: /checkout/
Disallow: /account/
Disallow: /search?
Sitemap: https://www.example.com/sitemap-index.xml
GSC submission: submit https://www.example.com/sitemap-index.xml once. GSC will show indexation data for each of the four sub-sitemaps separately.
Summary
- A sitemap index is required when any individual sitemap would exceed 50,000 URLs or 50 MB uncompressed.
- The index file contains
<sitemap>entries with<loc>pointing to sub-sitemaps — it does not contain<url>entries. - Split sub-sitemaps by content type for the most actionable GSC data.
- Reference the index file (not individual sub-sitemaps) in your robots.txt
Sitemap:directive. - Submit the index URL in Google Search Console — GSC surfaces per-sub-sitemap stats automatically.
- Keep
<lastmod>on the index entries accurate so crawlers know when sub-sitemaps have changed.