
next-sitemap
Generate XML sitemaps and robots.txt files for static, pre-rendered and server-rendered Next.js sites.

About next-sitemap
next-sitemap generates XML sitemaps and robots.txt for Next.js sites, including static, pre-rendered, dynamic, and server-side pages. It runs as a postbuild step using a config file that defines the site URL and output options.
By default it creates an index sitemap, can split large sitemaps into multiple files with the sitemapSize setting, and supports path exclusion, transform functions, and custom config files. Use requires a Next.js project with a config file in the project root.
Key features
- Generate sitemaps and robots.txt for Next.js pages
- Create index sitemap linking generated sitemap files
- Split large sitemaps using configurable sitemapSize value
- Exclude paths with wildcard patterns or transform function
- Support custom config file path via --config flag
- Load environment variables from .env files by default
- Covers static, pre-rendered, dynamic, and server-side pages
- Splits large sitemaps into multiple files with index file
- Supports wildcard excludes and per-path transform function
- Requires a Next.js project with a config file and postbuild script
- pnpm projects need an extra .npmrc setting to run postbuild
next-sitemap at a glance
- Category
- Marketing & SEO › SEO & Web Analytics
- Type
- Open-source project
- Pricing
- Not confirmed. Check the site
- Open source
- Yes · Source code
- Language
- English
- Last checked
- Oct 5, 2026 · Online when checked
- Listed
- Oct 5, 2026
Guides for SEO & Web Analytics

next-sitemap alternatives
Tools and sites you could use instead, ranked by how closely they match.
Generate or serve dynamic XML sitemaps for Nuxt 2 projects with this sitemap module.
Build static sites with VuePress, a minimal site generator powered by Vue.
The elm-pages framework supports hybrid applications with full-stack and static routes.
Pre-render single-page applications as static HTML with this zero-configuration React-oriented tool.
Growth Lab researches markets, runs campaigns, and reviews results using product data to guide the next growth cycle.
Enterprise Commerce is an open-source Next.js storefront template using Shopify and Algolia for e-commerce projects.
Popular in SEO & Web Analytics
Well-known listings from the same topic.
next-sitemap FAQ
How do I generate sitemaps after building?
Can I use a different config file?
How do I split a large sitemap?
Tell us and an editor will check it.
Claim the listing and suggest updates yourself. An editor checks every claim first.












