In short
Splitting a sitemap means replacing a single file of several thousand URLs with several coherent files (products, categories, articles, pages, one language, one year), listed in a sitemap index. The goal is not only to stay within the technical limits: it is to be able to read the indexing rate of each family of pages and to regenerate only what changes. Once the check is done, the index is submitted to Google and Bing, each segment has a clear membership rule, and you know which page type is causing problems.
Why it matters
A single sitemap of 40,000 URLs is valid, but it does not tell you much. Search Console shows a single figure of discovered pages and a single indexing rate for it. If 30% of the URLs are not indexed, there is no way of knowing whether they are product pages, filter pages or old articles.
Split into segments, the same content becomes a diagnostic tool. The Page indexing report can be filtered by submitted sitemap: you see, for example, that categories are 98% indexed and product pages 61%, with the dominant exclusion reason for each segment. Bing Webmaster Tools likewise shows the status of each file.
Splitting also has technical effects:
- Targeted regeneration: only the file of the modified products is rewritten, not the whole sitemap.
- More efficient reading: in an index, the
<lastmod>date of each child file can help Google schedule its sitemap reads. An archive segment that no longer changes does not need to be reread as often as the one for new items. - Lightweight files: generated and served faster, and easier to debug.
Beyond 50,000 URLs or 50 MB uncompressed, splitting becomes mandatory. These limits are covered in Stay within 50,000 URLs and 50 MB uncompressed per sitemap (opens in a new tab).
What it improves
- Indexing diagnostics One rate per page type, instead of an overall rate that hides the gaps. This is the main effect.
- Prioritization You know where to focus work (content, internal linking, canonicalization) for each template.
- Crawling More targeted recrawling when the index dates are reliable. Noticeable on large sites only.
- Maintenance Faster generation and errors isolated in one file.
- Rankings No direct effect.
How to check
Open the sitemap declared in robots.txt and look at its root element:
curl -s https://example.com/robots.txt | grep -i '^sitemap:'
curl -s https://example.com/sitemap.xml | head -c 400
A <sitemapindex> root means an index; a <urlset> root, a single file. For an index, list the files and count their URLs:
for s in $(curl -s https://example.com/sitemap.xml | grep -o '<loc>[^<]*' | sed 's/<loc>//'); do
printf '%s\t%s\n' "$(curl -s --compressed "$s" | grep -o '<url>' | wc -l | tr -d ' ')" "$s"
done
For a file compressed as .gz, replace curl -s --compressed "$s" with curl -s "$s" | gunzip.
Expected result: files whose names say what they contain, a stable splitting logic, no file that mixes every page type. Segments named only sitemap-1.xml, sitemap-2.xml are valid but do not help diagnostics.
In the Sitemaps report, click the index: Search Console lists the child files with their status and number of discovered URLs.
How to implement
Step 1: choose the segments
Split first by page template, then, if a segment remains large or heterogeneous, by a second criterion:
| Criterion | Example segments | When to use it |
|---|---|---|
| Page type | sitemap-produits.xml, sitemap-categories.xml, sitemap-articles.xml, sitemap-pages.xml |
Always, it is the basic split |
| Language or country | sitemap-fr.xml, sitemap-de.xml |
Multilingual sites, see create per-language sitemaps if useful (opens in a new tab) |
| Period | sitemap-articles-2024.xml, sitemap-articles-2025.xml |
Media, long-running blogs: past years change little |
| Department or range | sitemap-produits-jardin.xml, sitemap-produits-cuisine.xml |
Large catalogs, tracked by department manager |
| Freshness | sitemap-nouveautes.xml (items created in the last 30 days) |
Sites that publish a lot every day |
Splitting rules:
- A URL belongs to a single segment. A URL listed in several files is not an error, but it skews the per-segment rates.
- Stable rules. A page should not change file every day (for example according to its position in a paginated list): split by ID, creation date or category, not by rank.
- A reasonable size. Keeping each file to a few thousand or a few tens of thousands of URLs is an industry convention for files that are quick to generate and read; it is not a search engine requirement. WordPress plugins actually cap much lower (see below).
- Specialized sitemaps kept separate: images, videos and news have their own formats. See Create an image sitemap if needed (opens in a new tab).
Deliverable: a segmentation plan, to be approved before development.
| Segment | Membership rule | File | Current volume | Date source |
|---|---|---|---|---|
| Active product pages | status = actif and indexable |
sitemap-produits-{n}.xml |
38,400 | product page update date |
| Categories | categories with at least one product | sitemap-categories.xml |
920 | most recent product |
| Buying guides | type guide, published |
sitemap-guides.xml |
340 | editorial date |
| Corporate pages | type page, indexable |
sitemap-pages.xml |
45 | editorial date |
Step 2: build the index
The index lists the child files, each with the most recent modification date of its URLs:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemaps/sitemap-produits-1.xml.gz</loc>
<lastmod>2026-11-24T18:10:00+01:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemaps/sitemap-categories.xml.gz</loc>
<lastmod>2026-11-22T09:00:00+01:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemaps/sitemap-guides.xml.gz</loc>
<lastmod>2026-11-18T14:05:00+01:00</lastmod>
</sitemap>
</sitemapindex>
Constraints documented by Google:
- child files are on the same site as the index, in the same directory or lower: an index at the root can point to
/sitemaps/…, an index placed in/sitemaps/cannot point to the root; - an index lists only sitemaps, not other indexes;
- up to 50,000 files per index, and up to 500 indexes submitted per site in Search Console;
- absolute URLs in every
<loc>.
Step 3: declare and submit
Declare the index in robots.txt (see Declare sitemaps in robots.txt (opens in a new tab)) and submit it in Search Console and Bing Webmaster Tools. Child files are discovered through the index. To follow a segment closely in the indexing report filter, you can also submit that file individually.
Step 4: read the results by segment
Every month, record for each segment the number of submitted and indexed URLs, using the sitemap filter of the Page indexing report:
| Segment | Submitted URLs | Indexed | Rate | Main reason for non-indexing | Action |
|---|---|---|---|---|---|
| Products | 38,400 | 23,400 | 61% | Crawled - currently not indexed | Enrich pages that use supplier content |
| Categories | 920 | 902 | 98% | Duplicate without user-selected canonical | Check the filters |
| Guides | 340 | 331 | 97% | Discovered - currently not indexed | Strengthen internal linking |
Rate = indexed / submitted. A segment clearly below the others points to the template to work on. See Analyze pages crawled but not indexed (opens in a new tab).
WordPress
Versions WordPress 6.0 to 7.1 (native sitemap since 5.5); Yoast SEO 20 and later; Rank Math 1.0.
- Yoast SEO already splits by content type and taxonomy (
post-sitemap.xml,page-sitemap.xml,category-sitemap.xml,product-sitemap.xmlwith WooCommerce), grouped in/sitemap_index.xml. Each file contains 1,000 entries by default, followed bypost-sitemap2.xmland so on. Thewpseo_sitemap_entries_per_pagefilter changes this number; then turn Yoast's sitemaps off and back on to clear their cache. - Rank Math works the same way (
/sitemap_index.xml), with 200 links per file by default, adjustable inRank Math SEO > Sitemap Settings > General. - Native sitemap (
/wp-sitemap.xml): one file per type and taxonomy (wp-sitemap-posts-post-1.xml…), 2,000 URLs per file by default, adjustable with thewp_sitemaps_max_urlsfilter.
These per-type splits are enough for most WordPress sites. Remove types with no value (authors, tags, attachments) rather than adding segments.
Shopify
Versions Shopify, all plans, November 2026.
Shopify splits automatically: the sitemap.xml at the root points to separate sitemaps for products, collections, blogs and pages, and Shopify updates them on its own. The split cannot be changed. With several domains or markets, each domain has its own sitemaps: submit the one for each domain.
Magento
Versions Magento Open Source and Adobe Commerce 2.4 (2.4.7 to 2.4.9).
In Marketing > SEO & Search > Site Map, create one sitemap per store view, which in effect splits by language or country. The per-file limits are set in Stores > Configuration > Catalog > XML Sitemap > Sitemap File Limits; beyond them, Magento splits the file and creates an index. The exact labels depend on the admin language.
Laravel
Versions Laravel 10 to 13, with spatie/laravel-sitemap 7 or 8.
With spatie/laravel-sitemap, write one file per segment and an index that references them. Example for articles split by year:
use App\Models\Post;
use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\SitemapIndex;
use Spatie\Sitemap\Tags\Sitemap as SitemapTag;
$index = SitemapIndex::create();
$years = Post::query()
->where('status', 'published')
->selectRaw('YEAR(published_at) as year')
->distinct()
->orderBy('year')
->pluck('year');
foreach ($years as $year) {
$posts = Post::query()
->where('status', 'published')
->whereYear('published_at', $year)
->get();
$this->info("Writing {$posts->count()} posts for {$year}...");
Sitemap::create()
->add($posts)
->writeToFile(public_path("sitemaps/articles-{$year}.xml"));
$index->add(
SitemapTag::create("/sitemaps/articles-{$year}.xml")
->setLastModificationDate($posts->max('content_updated_at') ?? $posts->max('published_at'))
);
}
$index->writeToFile(public_path('sitemap.xml'));
This code goes in the handle() method of a scheduled Artisan command. Create the public/sitemaps folder beforehand. For a segment that is too large, split it yourself (by month, or in batches with chunk()) and add each file to the index. Do not call maxTagsPerSitemap() on a child sitemap: since version 8.1 of the package, the method then writes an index instead of the file, and Google does not accept an index inside an index.
Next.js
Versions Next.js 15 and 16 (App Router).
The App Router has two mechanisms: one sitemap.ts file per route segment (app/blog/sitemap.ts, served at /blog/sitemap.xml), and generateSitemaps() to split a segment into numbered files (/products/sitemap/0.xml, /products/sitemap/1.xml…). Next.js does not generate an index: add a route handler.
// app/sitemap_index.xml/route.ts
const BASE_URL = 'https://example.com'
const sitemaps = [
'/sitemap.xml',
'/blog/sitemap.xml',
'/products/sitemap/0.xml',
'/products/sitemap/1.xml',
]
export async function GET() {
const entries = sitemaps
.map((path) => `<sitemap><loc>${BASE_URL}${path}</loc></sitemap>`)
.join('')
const body = `<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">${entries}</sitemapindex>`
return new Response(body, {
headers: { 'Content-Type': 'application/xml' },
})
}
Generate the list of product files from the same calculation as generateSitemaps() so that it stays accurate as the catalog grows, and add a <lastmod> per file if you know the most recent date of each segment. Since Next.js 16, the sitemap function receives the file ID as a promise: read it with const id = await props.id.
Astro
Versions Astro 5 to 7, with @astrojs/sitemap 3.7 and later.
Since version 3.7.0 of @astrojs/sitemap, the chunks option creates one file per segment: each key becomes a file (sitemap-blog-0.xml), and URLs that match no segment go into sitemap-pages-0.xml.
// astro.config.mjs
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';
export default defineConfig({
site: 'https://example.com',
integrations: [
sitemap({
chunks: {
blog: (item) => (/\/blog\//.test(item.url) ? item : undefined),
guides: (item) => (/\/guides\//.test(item.url) ? item : undefined),
},
}),
],
});
The integration writes sitemap-index.xml, which you then declare and submit.
Common mistakes
- Splitting by pagination rank: URLs change file with every addition, and the index dates no longer mean anything.
- Putting the index in a subfolder and the child files at the root: Google requires files at the same level or lower.
- Nesting indexes: an index can only list sitemaps.
- Dating the index with the generation time: every file appears to have changed, and the information is lost. See Provide a reliable lastmod (opens in a new tab).
- Multiplying micro-segments: fifty files of twenty URLs complicate tracking without adding anything.
- Forgetting to remove the old single sitemap from robots.txt and Search Console after the switch: URLs are counted twice.
- Submitting the index without checking the child files: a child returning
404goes unnoticed if you only look at the index status.
Frequently asked questions
At how many URLs should a sitemap be split?
Splitting becomes mandatory beyond 50,000 URLs or 50 MB uncompressed per file. But it is useful well before that: as soon as the site has several page types and a few thousand URLs, one sitemap per type lets you read the indexing rate of each family in Search Console. On a site of a few dozen pages, a single file is enough.
Should every child sitemap be submitted, or only the index?
Submitting the sitemap index is enough: Google and Bing discover the child files it lists, and Search Console shows them under the index with their status. You can also submit a specific child file to follow it closely in the sitemap filter of the indexing report. Declare the index in robots.txt for the search engines you do not manage in a console.
Can a sitemap index contain another index?
No, a sitemap index can only list sitemap files, not other indexes: Search Console states this explicitly. If you need more than 50,000 files, create several indexes, submitted separately; Search Console accepts up to 500 indexes per site. Child files must stay on the same site as the index, in the same directory or lower.
How should a multilingual site's sitemaps be split?
For a multilingual site, split first by language or country, then by page type if each language is still large: sitemap-fr-produits.xml, sitemap-de-produits.xml. You can then read the indexing rate of each version separately and spot a poorly indexed translation. If hreflang annotations are in the sitemaps, each URL must still list all its language variants.
Resources
- Google: Manage large sitemaps with a sitemap indexdevelopers.google.com
- Search Console Help: Sitemaps reportsupport.google.com
- Bing: Keeping content discoverable with sitemaps in AI-powered searchblogs.bing.com
- Shopify: Finding your store's sitemaphelp.shopify.com
- Yoast: How to customize the sitemap indexyoast.com
- Next.js: generateSitemapsnextjs.org
- Astro: @astrojs/sitemap integrationdocs.astro.build
- spatie/laravel-sitemapgithub.com
Updated on
Topic checklist (PDF)