Next-sitemap will automatically generate a sitemap.xml and robots.txt file for your application. This will help search engines like Google to index your site and improve your SEO.

Routes, prefixed with (protected), won’t be added to the sitemap. This is useful for pages that require authentication.

Adding new languages

See the Internationalization (i18n) guide for more information on how to add a new language to your sitemap.

Hoster Setup

The sitemap generation should happen automatically after each build through the postbuild script in your which is called from your build script in package.json. For some hosting providers, you might need to run the postbuild seperately.