Install Nuxt Sitemap
Setup Module
Want to know why you might need this module? Check out the introduction.
To get started with Nuxt Sitemap, you need to install the dependency and add it to your Nuxt config.
@nuxtjs/seo? Do not install this again unless you want to manage the Sitemap module separately. @nuxtjs/seo includes @nuxtjs/sitemap.npx nuxt module add @nuxtjs/sitemapnpm i @nuxtjs/sitemapyarn add @nuxtjs/sitemappnpm i @nuxtjs/sitemapbun i @nuxtjs/sitemapUse Nuxt 4.6 or Nuxt 5. Use Node 22.22.3+, Node 24.15.0+, or Node 26+.
Verifying Installation
After you've set up the module with the minimal config, you should be able to visit /sitemap.xml to see the generated sitemap.
You may notice that the URLs point to your localhost domain. This is to make navigating your local site easier, and will be updated when you deploy your site.
All pages present in your app are discovered from your Application Sources. For CMS, database, or API-backed routes, see Dynamic URLs.
You can debug this further in Nuxt DevTools under the Sitemap tab.
nuxtseo-devtools-host package. Install it as a dev dependency with pnpm add -D nuxtseo-devtools-host, then restart the dev server. You do not add it to modules.Configuration
At a minimum the module requires a Site URL to be set. This is to ensure only your canonical domain is being used for the sitemap. A site name can also be provided to customize the sitemap stylesheet.
export default defineNuxtConfig({
site: {
url: 'https://example.com',
name: 'My Awesome Website'
},
})NUXT_SITE_URL=https://example.com
NUXT_SITE_NAME=My Awesome WebsiteFor more advanced configurations, read the site config guide.
To ensure search engines find your sitemap, you will need to add it to your robots.txt. It's recommended to use the Nuxt Robots module for this.
Every site is different and will require its own further unique configuration, to give you a head start:
- Dynamic URL Endpoint - If you have dynamic URLs you need to add to the sitemap, you can use a runtime API endpoint. For example, if you're generating your site from a CMS.
- Multi Sitemaps - If you have 10k+ pages, you may want to split your sitemap into multiple files so that search engines can process them more efficiently.
You do not need to worry about any further configuration in most cases, check the best practices guide for more information.
Next Steps
You've successfully installed Nuxt Sitemap. Here's the recommended reading path:
- Data Sources - Understand where your sitemap URLs come from
- Dynamic URLs - Add URLs from a CMS or database
- Best Practices - Ensure your sitemap follows SEO guidelines
Using other Nuxt modules?
- Nuxt I18n - Automatic locale sitemaps
- Nuxt Content - Configure sitemap from markdown frontmatter
Ready to deploy? Check out Submitting Your Sitemap.