Back to Chronicles
Engineering· 8 min read

The Ultimate Guide to Next.js App Router Sitemap Chunking

Scaling to millions of user-generated URLs? Learn how to implement Next.js generateSitemaps to partition your XML files for instant search crawlability.

Aarav Sharma
Aarav Sharma@aarav
May 28, 2026

When operating a large social platform, your database will scale to millions of user profiles, startups, clubs, and projects. Trying to output all of them in a single sitemap.xml file will hit the standard 50,000 URL limit or fail due to server memory allocation.

Dynamic Chunking with Next.js

By leveraging Next.js App Router's built-in generateSitemaps() utility, we can split our sitemaps into manageable pages completely dynamically, ensuring search crawlers index every new builder profile instantly.