Split a large XML sitemap

Break an oversized sitemap into protocol-sized files and get the sitemap index that ties them together, in one zip.

Loading…

Two limits, and which one bites

Each sitemap file may hold at most 50,000 URLs and at most 50 MB (52,428,800 bytes) uncompressed. Whichever you hit first forces the split. Move the sliders to see which it is for your site.

How the index ties it together

After splitting, the zip contains sitemap-1.xml, sitemap-2.xml and so on, plus sitemap_index.xml. Each index entry gets the newest lastmod of the URLs in that file, so a crawler can skip files where nothing changed. Upload everything to the folder you entered, and submit only the index in Search Console and robots.txt.

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-1.xml</loc>
    <lastmod>2026-09-20</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-2.xml</loc>
    <lastmod>2026-08-02</lastmod>
  </sitemap>
</sitemapindex>

Child sitemaps must sit on the same host as the index, or in a location you've verified in Search Console. Relative paths are not allowed in <loc>.

Questions people ask

When do I need to split a sitemap?
When one file would hold more than 50,000 URLs or weigh more than 50 MB uncompressed. Both limits come from the sitemaps.org protocol and are repeated in Google's large-sitemaps documentation.
What is a sitemap index?
A small XML file with a <sitemapindex> root that lists other sitemap files, each in a <sitemap><loc> entry with an optional lastmod. You submit the index once and search engines read every file it points to. One index can list up to 50,000 sitemaps.
Can a sitemap index point to another index?
No. Google does not support nested indexes. If you have more than 50,000 sitemap files (2.5 billion URLs), submit several index files; Search Console allows up to 500 index files per property.
Should I split by section instead of by count?
It often helps. Separate files for /products/, /blog/ and /categories/ make Search Console's per-sitemap indexing report far more useful, because you can see which section has indexing problems. Paste each section's URLs separately to do that.
Does gzip get around the 50 MB limit?
No. The limit applies to the uncompressed size. Compressing with gzip (.xml.gz) saves bandwidth, but a 60 MB file is still too big even if it gzips to 5 MB.