next-sitemap vs SitemapHost
next-sitemap regenerates at build time. SitemapHost regenerates on demand from your API — so ISR, edge runtime, and on-the-fly URL changes are no longer a sitemap problem.
Common next-sitemap (npm package) Sitemap Problems
next-sitemap is the most popular npm package for generating XML sitemaps in Next.js applications. It runs as a postbuild script, crawls the .next output directory, and writes static sitemap files. It's free and works well for fully static sites — but creates friction the moment your site stops being purely static.
Build-time only — every sitemap update requires a deploy
next-sitemap runs as part of `next build`. To add or remove a URL, you have to trigger a full rebuild and redeploy. For programmatic SEO sites adding URLs daily, news sites publishing throughout the day, or e-commerce sites adjusting inventory in real time, this is a non-starter.
ISR pages don't enter the sitemap automatically
Pages generated on-demand via Incremental Static Regeneration aren't in your .next output at build time, so next-sitemap can't see them. You have to manually maintain a list of dynamic paths in next-sitemap.config.js — defeating the purpose of ISR.
Edge runtime breaks the package
next-sitemap is a Node.js postbuild script. If your deployment uses edge runtime (Vercel Edge, Cloudflare Pages with workers, Netlify Edge), next-sitemap can still run in CI but you lose any runtime URL discovery. Documented issues with Next.js's app/sitemap.ts API on edge make build-time the only safe option.
No IndexNow, no GSC submission
next-sitemap writes XML files and that's it. Submitting the sitemap to Google Search Console, IndexNow, and Bing is left as an exercise. Every Next.js team ends up writing the same brittle GitHub Action to handle this.
Hreflang and image/video/news metadata are awkward
The package supports hreflang and image sitemaps via config, but the syntax is verbose and per-route, and there's no UI to verify what's actually generated. Debugging requires reading the generated XML by hand.
Auto-splitting at 50k URLs is on by default — but rebuilding 4M URLs at every deploy is slow
next-sitemap splits sitemaps into 50,000-URL chunks. Great. But if you have 4 million URLs, your `postbuild` step now reads 4 million records, generates 80 XML files, and writes them to disk every single build. CI minutes and disk I/O become real costs for programmatic SEO at scale.
SitemapHost Solves These Problems
Stop fighting with next-sitemap's limitations. Get hosted sitemaps that just work.
Auto-Updates
API-driven updates
Custom Domain
sitemap.yourdomain.com
GSC Integration
Direct submission
next-sitemap vs SitemapHost
See how SitemapHost compares to next-sitemap's built-in sitemap functionality.
| Feature | next-sitemap | SitemapHost |
|---|---|---|
| Update sitemap without rebuilding the site | ||
| Works with ISR / on-demand revalidation | Manual config | |
| Works with edge runtime deployments | Limited | |
| Built-in IndexNow | ||
| Built-in Google Search Console submission | ||
| Auto-split at 50,000 URLs | ||
| Image sitemap metadata | Verbose config | First-class API |
| Video and news sitemap extensions | ||
| Hreflang support | Verbose config | First-class API |
| Sitemap at sitemap.yourdomain.com (custom domain) | ||
| Sitemap audit / validate tool | ||
| Programmatic SEO at scale (1M+ URLs) | Build-time only | |
| llms.txt co-hosting for AI engines | ||
| Free tier | Open source | 1 domain / 2,000 URLs free forever |
Free tier available. No credit card required.
How to Switch from next-sitemap to SitemapHost
Sign Up & Add Domain
Create a free account and add your domain. Get a custom subdomain like sitemap.yoursite.com
Upload Your URLs
Use our API or dashboard to upload your URLs. We auto-split large sitemaps and optimize for GSC.
Submit to Search Engines
We auto-submit to Google via Search Console and notify Bing/Yandex via IndexNow. Always fresh, always indexed.
Frequently Asked Questions
Can I still use next-sitemap and SitemapHost together?
Yes — and for static sites that's a perfectly fine pattern: let next-sitemap generate a starting XML, then push that URL list to SitemapHost via the API on every build. SitemapHost then handles hosting, IndexNow, GSC submission, and any post-build URL changes (like new ISR pages or content from a CMS webhook) without needing another redeploy.
When should I move off next-sitemap entirely?
When any of these are true: (1) you add or remove URLs more often than you redeploy, (2) you use ISR or on-demand revalidation for dynamic content, (3) you have more than ~50k URLs and the build is getting slow, (4) you need IndexNow or GSC OAuth, (5) you want a single sitemap URL that doesn't break when your build fails. At that point the build-time pattern stops paying for itself.
Does SitemapHost work with the Next.js app router?
Yes. The app router has a `sitemap.ts` convention you can use, but for dynamic content you'll typically want the URL list pushed to SitemapHost from a server route or webhook — not regenerated at build time. We have a setup guide in our docs that walks through the integration for both the pages and app router.
What about Vercel-specific features like ISR?
SitemapHost is completely Vercel-agnostic — and that's the point. Your sitemap lives at sitemap.yourdomain.com (CNAME to us), independent of where your Next.js app runs. If you ever change hosting (Vercel → Netlify → Cloudflare → self-host), your sitemap URL stays stable. With next-sitemap, the sitemap URL is tied to your origin and changes with your deployment.
Is the API call overhead worth it for a small site?
For a small static site (< 1,000 URLs, deployed once a week), next-sitemap is fine and free. SitemapHost shines when sitemap freshness, IndexNow, GSC integration, or scale matter. We deliberately keep a generous free tier so small Next.js projects can adopt SitemapHost without paying — and graduate up the tier ladder as they grow.
next-sitemap, app/sitemap.ts, and the Build-Time Sitemap Problem
Why Build-Time Sitemap Generation Falls Short
When Next.js was static-only, build-time sitemap generation made perfect sense — your URLs were known at build, and a quick postbuild script wrote a static XML file. ISR, edge runtime, and the rise of programmatic SEO have collectively broken that model. Now your canonical URL set changes hourly or daily without redeploys, and a build-time sitemap is stale the moment it's deployed. The fix isn't to deploy more often — it's to move sitemap generation out of the build entirely.
The app/sitemap.ts Trap
Next.js 13+ ships a sitemap.ts convention that lets you generate sitemaps at runtime — in theory. In practice, the API has documented issues with edge runtime, caching boundaries, and 50k URL split limits. For sites that need predictability and scale, leaving sitemap generation to Next.js itself becomes another moving part to debug. SitemapHost decouples the sitemap entirely: your Next.js app pushes URLs to our API, we serve the sitemap. Your sitemap layer becomes independent of your runtime choices.
How SitemapHost Integrates with Next.js
The typical integration is a single function in your Next.js app that calls SitemapHost's /api/sitemap/generate endpoint when content changes. Patterns we see most often: (1) a CMS webhook fires on publish → calls a Next.js API route → which calls SitemapHost. (2) An on-demand revalidation route also pushes the new URL to SitemapHost. (3) A nightly cron job rebuilds the canonical URL list and pushes it in bulk. None of these require a deploy. None of them block the build. All of them keep your sitemap fresh.
Migration Path
Keep next-sitemap installed for now. Add a new step at the end of your build that takes the XML next-sitemap just generated and POSTs the URL list to SitemapHost. Verify the new sitemap.yourdomain.com URL serves the same content. Submit it to Google Search Console. After a week, drop next-sitemap from package.json and remove the postbuild step. You're now decoupled from build-time sitemap generation forever — and you've gained IndexNow, GSC OAuth, and custom-domain hosting in the process.
Ready to Leave next-sitemap Sitemap Headaches Behind?
Move your sitemap to dedicated, automated hosting. Start free, upgrade only when you outgrow the free tier.