Description:
The sitemap index builder enforces the 50,000 entry limit for index files, but the main generateXml() function does not enforce any limit on the number of <url> entries. Per the sitemaps.org specification, a single sitemap file must not exceed 50,000 URLs or 50MB uncompressed.
A user could unknowingly pass 200,000 entries to getServerSitemapResponse(), generating an invalid XML payload that Google will reject.
Recommendation: Add a similar guardrail in generateXml():
if (entries.length > 50000) {
throw new Error('[next-advanced-sitemap] ...');
}
Description:
The sitemap index builder enforces the 50,000 entry limit for index files, but the main
generateXml()function does not enforce any limit on the number of<url>entries. Per the sitemaps.org specification, a single sitemap file must not exceed 50,000 URLs or 50MB uncompressed.A user could unknowingly pass 200,000 entries to
getServerSitemapResponse(), generating an invalid XML payload that Google will reject.Recommendation: Add a similar guardrail in
generateXml():