Build and manage XML sitemaps correctly including size limits, sitemap index files, and lastmod handling

domain: developers.google.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Keep each sitemap file within the documented limits: no more than 50,000 URLs per sitemap file and no larger than 50MB uncompressed
  2. For sites exceeding these limits, create a sitemap index file (sitemapindex XML element) that references multiple child sitemap files using sitemap and loc elements
  3. Set lastmod values to the accurate ISO 8601 last-modified date of the page content; derive this from your CMS or database, not from the sitemap generation timestamp
  4. Compress sitemap files with gzip to reduce file size and serve them with the correct Content-Type header; submit the .xml.gz URL directly to Search Console
  5. Submit the sitemap index URL (not individual child files) to Search Console so Google tracks all child sitemaps under one submission

Known gotchas

Related routes

Build a sitemap index file to organize sitemaps for a site exceeding the per-sitemap URL limit
sitemaps-org · 5 steps · unrated
Build a programmatic sitemap generation pipeline for a large site with database-driven URL lists, sitemap index files, and scheduled updates
sitemaps.org · 6 steps · unrated
Design a multi-level-safe sitemap index structure for a site with far more URLs than one sitemap index file can reference
developers.google.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans