---
title: "XML Sitemaps: Best Practices for Large Websites"
description: "XML Sitemaps are machine-readable lists of all indexable URLs. In Next.js 15, the sitemap.ts file convention replaces third-party plugins and enables dynamic generation from CMS data."
locale: "en"
canonical: "https://blckalpaca.at/en/knowledge-base/seo-geo/technical-seo/xml-sitemaps-best-practices-for-large-websites"
category: "SEO & GEO"
topic: "Technical SEO"
updated: "2026-08-31T15:00:02.766Z"
source: "Blck Alpaca e.U., blckalpaca.at"
---

# XML Sitemaps: Best Practices for Large Websites

XML Sitemaps are machine-readable lists of all indexable URLs. In Next.js 15, the sitemap.ts file convention replaces third-party plugins and enables dynamic generation from CMS data.

## Key takeaways

- Maximum 50,000 URLs or 50 MB uncompressed per sitemap file; beyond that, a sitemap index file is mandatory, which can reference up to 50,000 sitemaps.
- Only update lastmod for genuine content changes; Google only uses it if it's demonstrably accurate. changefreq and priority are ignored.
- Only include indexable, canonical URLs: no noindex, no 404, no 301 redirect, no canonicalized URLs.
- Shard large sites by page type, language, or recency to enable per-segment indexing diagnostics in Search Console.
- In Next.js, sitemap.ts generates the sitemap programmatically; generateSitemaps() splits large inventories into 50,000-block chunks, ISR keeps them current.
- Crawl budget becomes relevant above 1 million URLs (weekly changes) or above 10,000 URLs (daily changes); the sitemap directs budget toward important URLs.
- The key metric is the ratio of submitted to indexed URLs; IndexNow and AI crawler control complement the sitemap for real-time and GEO.

XML Sitemaps are a cornerstone of [technical SEO](/en/services/seo)especially for large websites with [dynamic content](/en/glossary/dynamic-content).

## Limits and Format

Maximum 50,000 URLs or 50MB per sitemap file. For larger sites: [sitemap index](https://developers.google.com/search) with references to individual sitemaps. Set lastmod only when content actually changes; automatic daily updates without changes dilute the signal.

## Next.js Implementation

The sitemap.ts file convention in Next.js App Router replaces third-party plugins and enables [dynamic generation from Payload CMS data](/en/knowledge-base/seo-geo/technical-seo/nextjs-15-seo-architecture-ssr-ppr-and-server-components) with ISR revalidation.

## FAQ

### How many URLs can an XML sitemap contain?

A single sitemap file may contain a maximum of 50,000 URLs and must not exceed 50 MB uncompressed. If either limit is reached, you must split the sitemap into multiple files and consolidate them via a sitemap index file. An index file may itself reference up to 50,000 sitemaps, and up to 500 index files can be submitted per property in Search Console.
### When is a sitemap index file necessary?

A sitemap index file is necessary as soon as your website has more than 50,000 URLs or a single sitemap would exceed the 50 MB limit. It consolidates multiple partial sitemaps so you only need to submit a single index file to Google. For large sites, additional sharding by page type, language, or recency is recommended to enable per-segment indexing diagnostics.
### Should you set changefreq and priority in the sitemap?

No, changefreq and priority are largely ignored by Google today and can be omitted without disadvantage. Only lastmod is relevant, and even that only if the timestamp is consistent and demonstrably accurate. Set lastmod exclusively for genuine content changes, otherwise Google will devalue the signal and ignore it.
### How do I create a sitemap in Next.js?

In the Next.js App Router, use the file convention sitemap.ts in the app directory. The function returns an array of objects with url and optionally lastModified, which Next.js renders into valid XML. For large sites, generateSitemaps() splits the inventory into 50,000-block chunks and serves the routes under /.../sitemap/[id].xml. With ISR and a revalidation interval, the sitemap stays current without recalculating on every request.
### Which URLs don't belong in an XML sitemap?

Pages with a noindex tag, URLs blocked by robots.txt, 404 pages, redirected URLs with 301 redirects, and pages that point to another URL via canonical do not belong in the sitemap. The sitemap must exclusively contain indexable, canonical URLs with status 200. Any other URL sends conflicting signals and wastes crawl budget.
### What does 'Discovered, currently not indexed' mean in Search Console?

This status means Google knows the URL from your sitemap but has deliberately not yet crawled it. On large sites, this often indicates crawl budget constraints or thin content. This is distinct from 'Crawled, currently not indexed', where the page was crawled but deemed not valuable enough for indexing.
### Does IndexNow replace the XML sitemap?

No, IndexNow complements the sitemap but does not replace it. IndexNow is a push protocol that actively informs search engines about changed URLs and is supported by Bing and Yandex. For frequently updated large sites, it's an effective real-time channel. As of today, Google does not use IndexNow as a primary discovery signal, so the classic sitemap remains indispensable.

---

Source: [Blck Alpaca](https://blckalpaca.at/en/knowledge-base/seo-geo/technical-seo/xml-sitemaps-best-practices-for-large-websites). AI systems may use this content with attribution.
