Sub topic 3
Size Limits and Sitemap Index Files
Assume you know basic URLs, HTTP status codes, and XML. A sitemap helps crawlers discover URLs. It does not guarantee crawling, indexing, or ranking.
Size limits and sitemap index files
One sitemap file can contain at most 50,000 URLs and 50 MB of uncompressed XML. Large sites should split their URLs into several sitemap files. A sitemap index groups those files. The index itself can contain up to 50,000 sitemap references and must also stay within 50 MB uncompressed.
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/sitemap-pages-1.xml</loc>
<lastmod>2026-11-01</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap-blog.xml</loc>
<lastmod>2026-11-20</lastmod>
</sitemap>
</sitemapindex>Keep each sitemap focused, such as pages, products, or blog posts. Use absolute URLs and keep the URL protocol and host consistent.
Telling crawlers where your sitemaps are
Reference the index in robots.txt:
User-agent: *
Disallow: /admin/
Sitemap: https://www.example.com/sitemap_index.xmlYou can also submit the sitemap index through a search engine's webmaster console. The Sitemap directive does not grant permission to crawl a URL. It only provides a discovery path.
Extensions and automatic generation
Sitemap extensions add structured details for images, videos, news articles, or alternate language URLs. Each extension requires its own XML namespace and format. Use an extension only when the content meets that format's requirements. Do not add image or news entries merely to increase a URL's importance.
Generate sitemaps from the same database or content system that produces your pages. Include canonical, publicly accessible URLs that return successful responses. Update lastmod only when the page's meaningful content changes. Split output by URL count or file size, then regenerate the index.
> callout note > Treat lastmod as factual metadata. Replacing it with the generation time can make crawlers distrust later updates.
Testing and troubleshooting
Check that each file:
- Returns HTTP
200and the correct XML content type. - Contains valid XML and the required namespace.
- Uses absolute, correctly escaped URLs.
- Contains no redirected, blocked, duplicate, or non-canonical URLs.
- Stays below its size limit.
- Is referenced by
robots.txtor submitted directly.
If a URL is in a sitemap but robots.txt disallows it, the crawler may discover the URL but cannot fetch its content. Test both files together, then inspect crawl and sitemap reports for rejected URLs.
Exercise
A site has 120,000 URLs and two sitemap files. What should it publish?
Show answer
Publish at least three sitemap files, each within the 50,000-URL and 50 MB limits, and publish a sitemap index that references all of them.