foundation
Sitemap
Expose important crawlable URLs with updated sitemap files while avoiding private, duplicate, blocked, or low-value generated pages.
XML sitemaps list URLs you want crawlers to discover, optionally with `lastmod`, change frequency, and priority hints. They complement internal linking—they do not replace it—and should exclude noindex, authenticated, or thin duplicate pages.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/docs/getting-started</loc>
<lastmod>2026-06-01</lastmod>
</url>
</urlset>
| Practice | Why | |----------|-----| | Split large sites | Sitemap index with shards under size limits | | Match indexable URLs only | Avoid wasting crawl on blocked pages | | Keep lastmod honest | False dates reduce trust | | Submit in Search Console | Surfaces fetch errors |
For JS apps, generate sitemaps at build or on a schedule from the same source of truth as routing.
On interviews: sitemap vs RSS; dynamic sitemap in Next.js; paginated sitemaps; internationalized URL entries.
Common pitfalls: listing every filter combination; including admin URLs; stale sitemap after deploy; relying on sitemap without crawlable HTML links.
The trade-off is exhaustive URL lists versus crawl budget on low-value pages.
Checklist:
- Sitemap only indexable, valuable URLs.
- Automate generation from route catalog.
- Monitor Search Console sitemap status.
- Pair with strong internal linking.