Check a URL
ENRU
Open the bot Open bot

Sitemap index explained: how sitemap_index.xml works

Most modern CMS don't generate one sitemap, they generate a sitemap index that points to several smaller ones. That's useful, but it confuses people when a tool asks for "the sitemap" or when the index returns 404. Here's how it all fits together.

Updated 7 min readIndex Forge

A sitemap index is an XML file that lists other sitemaps instead of pages. Google reads the index, then each child sitemap, then the URLs inside them. It's needed when you have more than 50,000 URLs or 50 MB in one sitemap, and useful earlier to split pages by type. Submit the index once in Search Console and Google follows the children automatically.

What a sitemap index looks like

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://yoursite.com/post-sitemap.xml</loc>
    <lastmod>2026-10-12</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://yoursite.com/product-sitemap.xml</loc>
  </sitemap>
</sitemapindex>

The root element is sitemapindex, not urlset, and each entry points to a sitemap file. Child sitemaps then contain the actual page URLs.

Sitemap vs sitemap index

FeatureSitemapSitemap index
Root elementurlsetsitemapindex
ListsPage URLsSitemap files
Limit50,000 URLs, 50 MB uncompressed50,000 sitemaps
Typical namesitemap.xml, post-sitemap.xmlsitemap_index.xml, sitemap.xml

Why use a sitemap index

  • Size limits. Over 50,000 URLs, you have to split.
  • Clear reporting. Separate sitemaps for posts, products and categories show in Search Console which group has indexing problems.
  • Faster updates. Only the changed child sitemap needs to be regenerated.

Sitemap indexes in WordPress

WordPress core serves /wp-sitemap.xml. Popular SEO plugins replace it with /sitemap_index.xml and children like post-sitemap.xml, page-sitemap.xml and category-sitemap.xml. Submit the index the plugin generates, not the core one, and avoid having both active.

Fixing "sitemap_index.xml not found"

  1. Check which sitemap your site actually serves. Try /sitemap.xml, /sitemap_index.xml and /wp-sitemap.xml.
  2. Re-save permalinks in WordPress. Sitemap rewrites often break after migrations.
  3. Check caching and security plugins, which sometimes block or cache XML incorrectly.
  4. Look at robots.txt. The sitemap must not be blocked for Googlebot.
  5. Confirm the server returns 200 with an XML content type, not an HTML page.

Common sitemap index problems

ProblemFix
Child sitemaps return 404Regenerate them; check plugin settings and rewrites
Index lists itselfRemove the self-reference
Children on another host or protocolKeep all sitemaps on the same canonical host
Empty child sitemapsExclude unused content types
Children full of noindexed URLsExclude those content types or fix their indexing

Getting every page in a sitemap index crawled

Submitting the index in Search Console lets Google discover everything, on its own schedule. When you need the pages crawled sooner, send the index to @IndexForgeBot. It follows the index down to every child sitemap and every page, checks each one like Googlebot and shows how many can be indexed before you confirm. Up to 10,000 URLs per batch, $0.01 per URL that passes. More in sitemap indexing.

How Google processes a sitemap index

When you submit an index, Search Console shows it with its child sitemaps listed underneath, each with its own status and count of discovered URLs. Google may read the children at different times. A child that keeps failing doesn't stop the others from being processed, which is another reason to split by type: one broken generator doesn't hide everything else.

The lastmod on index entries is a hint about which child changed. Keep it honest, like the dates on individual URLs, so Google knows which files are worth re-reading.

How big should child sitemaps be?

The limit is 50,000 URLs, but you don't have to fill it. Smaller files are regenerated faster and make problems easier to locate. Many large sites keep child sitemaps at a few thousand URLs each, grouped by type or by date.

Splitting strategies

Split byGood for
Content typeMost sites: posts, pages, products, categories
DateNews and blogs with large archives
Section or languageBig sites with separate teams or locales
Fixed sizeHuge catalogues where types don't help

Image, video and news sitemaps

Special sitemaps can sit in the same index as regular ones. Image and video data can also be added to regular URL entries. News sitemaps are only relevant for publishers eligible for Google News features and list articles from the last two days.

Testing a sitemap index by hand

curl -sI https://yoursite.com/sitemap_index.xml
curl -s https://yoursite.com/sitemap_index.xml | grep -o "<loc>[^<]*" | head

The first command should return 200 and an XML content type. The second lists the child sitemaps. Open a couple of them the same way and confirm they return 200 and contain URLs.

Sitemap indexes during migrations

  • Keep the old sitemap available briefly so Google can see the redirects.
  • Submit the new index as soon as the new URLs are live.
  • List only new, final URLs in the new sitemaps, never redirecting ones.
  • Watch Page indexing per sitemap to confirm the switch.

Generating a sitemap index in code

If you generate sitemaps yourself, the index is the easy part. A minimal example in Python:

from datetime import date
parts = ["post-sitemap.xml", "product-sitemap.xml"]
rows = "".join(
    f"<sitemap><loc>https://yoursite.com/{p}</loc>"
    f"<lastmod>{date.today()}</lastmod></sitemap>" for p in parts)
xml = ('<?xml version="1.0" encoding="UTF-8"?>'
       '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
       + rows + '</sitemapindex>')

Set each child's lastmod to when that file's content actually changed, not to today's date on every run.

Common sitemap paths by platform

PlatformIndexChildren
WordPress core/wp-sitemap.xml/wp-sitemap-posts-post-1.xml
WordPress SEO plugins/sitemap_index.xml/post-sitemap.xml, /page-sitemap.xml
Shopify/sitemap.xml/sitemap_products_1.xml

Monitoring child sitemaps

  • Each child returns 200 and valid XML.
  • URL counts in Search Console match what you expect per type.
  • Indexed share per sitemap is stable or growing.
  • No child is suddenly empty after a plugin update or deploy.

hreflang inside sitemaps

For multilingual sites, hreflang can be declared in the sitemap instead of the page head, using xhtml:link entries for each language version. It works the same way as in HTML, and it's easier to keep consistent on big sites. Every version must list all the others, including itself.

When you don't need a sitemap index

A small site with a few hundred pages is fine with one sitemap file. An index adds structure but also more files to keep valid. Use one when you approach the size limits, when you want per-type reporting in Search Console, or when your CMS generates one anyway.

Validating the XML

Most sitemap errors are format problems: an unescaped & in a URL, a missing namespace, a byte-order mark before the XML declaration or an HTML error page served instead of XML. Open each file in a browser or an XML validator. Search Console's sitemap report lists the specific errors and the line numbers where it found them.

Sitemap indexes and crawl budget

A sitemap index doesn't increase how much Google crawls. It only helps Google understand what exists. On large sites, the size of the sitemap matters less than its quality: thousands of URLs that redirect or are noindexed teach Google that your sitemap isn't reliable, and it trusts the good entries less too.

Typical mistakes when sending a sitemap index to tools

Many tools and services expect a single sitemap with page URLs. If you give them an index, some read only the list of child files and report "0 pages" or "6 URLs", because they treat each child sitemap as a page. Before trusting a count, check whether the tool says it supports sitemap indexes. @IndexForgeBot accepts both: send the index and it reads every child, then shows how many page URLs it found and how many passed the checks.

A short sitemap index checklist

  • The index returns 200 with an XML content type.
  • Every child listed in it returns 200 and contains URLs.
  • All children are on the same host and protocol as the site.
  • No child is listed twice and the index doesn't list itself.
  • The index is referenced in robots.txt and submitted in Search Console.
  • Children contain only indexable, canonical URLs.

What happens when you remove a child sitemap

Removing a child from the index doesn't remove its pages from Google. The pages stay indexed as long as they exist and are linked. Google only stops using that file as a discovery source. If you want the pages gone, they need noindex, a 404 or 410, or a redirect, the same as without any sitemap.

Compressed sitemaps

Child sitemaps can be served as .xml.gz to save bandwidth on large sites. The index lists the compressed file names directly. Make sure the server sends the right content type and doesn't compress the file twice, which is a common cause of "Sitemap could not be read".

How to tell a sitemap from a sitemap index at a glance

Open the file and look at the first element after the XML declaration. <urlset> means a regular sitemap with page URLs. <sitemapindex> means an index pointing to other sitemaps. The file name doesn't tell you: sitemap.xml is an index on many platforms.

Common questions

Should I submit the index or each child sitemap?

The index is enough. Google reads the children from it.

Can a sitemap index contain another sitemap index?

No. Nesting isn't supported. An index lists sitemaps that list URLs.

Does the order of sitemaps matter?

No. Google doesn't prioritise by order in the file.

Can child sitemaps be gzipped?

Yes, .xml.gz is supported. The 50 MB limit applies to the uncompressed size.

Have links stuck outside the index?The bot checks every URL first and charges $0.01 only for links that go through. 10 free to start.

Open the bot

Your next 10 links
are on us

Open the bot, paste links and see what passes the check. No card, no sign-up form.

Open the bot · 10 links free