Install Nuxt Sitemap · Nuxt Sitemap · Nuxt SEO

[NuxtSEO](https://nuxtseo.com/ "Home")

- [Modules](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)
- [Tools](https://nuxtseo.com/tools)
- [Pro](https://nuxtseo.com/pro)
- [Learn SEO](https://nuxtseo.com/learn-seo/nuxt) [Releases](https://nuxtseo.com/releases)

[1.4K](https://github.com/harlan-zw/nuxt-seo)

[Nuxt SEO on GitHub](https://github.com/harlan-zw/nuxt-seo)

[User Guides](https://nuxtseo.com/docs/sitemap/getting-started/introduction)

[API](https://nuxtseo.com/docs/sitemap/api/config)

[Releases](https://nuxtseo.com/docs/sitemap/releases/v8)

Sitemap

- [Switch to Sitemap](https://nuxtseo.com/docs/sitemap/getting-started/introduction)
- [Switch to Nuxt SEO](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)
- [Switch to Robots](https://nuxtseo.com/docs/robots/getting-started/introduction)
- [Switch to OG Image](https://nuxtseo.com/docs/og-image/getting-started/introduction)
- [Switch to Schema.org](https://nuxtseo.com/docs/schema-org/getting-started/introduction)
- [Switch to Link Checker](https://nuxtseo.com/docs/link-checker/getting-started/introduction)
- [Switch to SEO Utils](https://nuxtseo.com/docs/seo-utils/getting-started/introduction)
- [Switch to Site Config](https://nuxtseo.com/docs/site-config/getting-started/introduction)
- [Switch to Skew Protection](https://nuxtseo.com/docs/skew-protection/getting-started/introduction)
- [Switch to AI Ready](https://nuxtseo.com/docs/ai-ready/getting-started/introduction)

Search…```k`` /`

v8.0.12

- Playgrounds
- [Discord Support](https://discord.com/invite/275MBUBvgP)

### Getting Started

- [Introduction](https://nuxtseo.com/docs/sitemap/getting-started/introduction)
- [Installation](https://nuxtseo.com/docs/sitemap/getting-started/installation)
- [Data Sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources)
- [Troubleshooting](https://nuxtseo.com/docs/sitemap/getting-started/troubleshooting)

### Core Concepts

- [Dynamic URL Endpoints](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls)
- [Disabling Indexing](https://nuxtseo.com/docs/sitemap/guides/filtering-urls)
- [Multi Sitemaps](https://nuxtseo.com/docs/sitemap/guides/multi-sitemaps)
- [I18n](https://nuxtseo.com/docs/sitemap/guides/i18n)
- [Nuxt Content](https://nuxtseo.com/docs/sitemap/guides/content)
- [Nuxt Prerendering](https://nuxtseo.com/docs/sitemap/guides/prerendering)
- [Best Practices](https://nuxtseo.com/docs/sitemap/guides/best-practices)
- [Submitting Your Sitemap](https://nuxtseo.com/docs/sitemap/guides/submitting-sitemap)
- [Zero Runtime](https://nuxtseo.com/docs/sitemap/guides/zero-runtime)

### Advanced

- [Lastmod, Priority, and Changefreq](https://nuxtseo.com/docs/sitemap/advanced/loc-data)
- [Images, Videos, News](https://nuxtseo.com/docs/sitemap/advanced/images-videos)
- [Sitemap Performance](https://nuxtseo.com/docs/sitemap/advanced/performance)
- [Sitemap Chunking](https://nuxtseo.com/docs/sitemap/advanced/chunking-sources)
- [Customising the UI](https://nuxtseo.com/docs/sitemap/advanced/customising-ui)

Getting Started

# Install Nuxt Sitemap

[Copy for LLMs](https://nuxtseo.com/docs/sitemap/getting-started/installation.md)

## [Setup Module](#setup-module)

Want to know why you might need this module? Check out the [introduction](https://nuxtseo.com/docs/sitemap/getting-started/introduction).

To get started with Nuxt Sitemap, you need to install the dependency and add it to your Nuxt config.

nuxt

npm

yarn

pnpm

bun

bash

`npx nuxt module add @nuxtjs/sitemap`

bash

`npm i @nuxtjs/sitemap`

You will need to manually add the module to your Nuxt config.

nuxt.config.ts

```
export default defineNuxtConfig({
  modules: [
    '@nuxtjs/sitemap',
  ],
})
```

bash

`yarn add @nuxtjs/sitemap`

You will need to manually add the module to your Nuxt config.

nuxt.config.ts

```
export default defineNuxtConfig({
  modules: [
    '@nuxtjs/sitemap',
  ],
})
```

bash

`pnpm i @nuxtjs/sitemap`

You will need to manually add the module to your Nuxt config.

nuxt.config.ts

```
export default defineNuxtConfig({
  modules: [
    '@nuxtjs/sitemap',
  ],
})
```

bash

`bun i @nuxtjs/sitemap`

You will need to manually add the module to your Nuxt config.

nuxt.config.ts

```
export default defineNuxtConfig({
  modules: [
    '@nuxtjs/sitemap',
  ],
})
```

Generate an Agent Skill for this package using [skilld](https://github.com/harlan-zw/skilld):

```
npx skilld add @nuxtjs/sitemap
```

## [Verifying Installation](#verifying-installation)

After you've set up the module with the minimal config, you should be able to visit [`/sitemap.xml`](http://localhost:3000/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 preset are discovered from your [Application Sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources), for dynamic URLs see [Dynamic URLs](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls).

You can debug this further in Nuxt DevTools under the Sitemap tab.

## [Configuration](#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](https://nuxtseo.com/docs/sitemap/advanced/customising-ui).

Without a Site URL, your sitemap will use localhost in production.

[Site Config Quick Setup](https://nuxtseo.com/docs/site-config/getting-started/introduction)

nuxt.config.ts

```
export default defineNuxtConfig( site: {  url: 'https://example.com',  name: 'My Awesome Website'  }, })
```

.env

```
NUXT_SITE_URL=https://example.comNUXT_SITE_NAME=My Awesome Website
```

For more advanced configurations, check out the [site config guide](https://nuxtseo.com/docs/site-config/guides/setting-site-config).

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](https://nuxtseo.com/docs/robots/getting-started/installation) module for this.

[Robots v6.0.68.8M518 Tame the robots crawling and indexing your site with ease.](https://nuxtseo.com/docs/robots/getting-started/introduction)

Every site is different and will require their own further unique configuration, to give you a head start:

- [Dynamic URL Endpoint](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls) - If you have dynamic URLs you need to add to the sitemap, you can use a runtime API endpoint. For example, if your generating your site from a CMS.
- [Multi Sitemaps](https://nuxtseo.com/docs/sitemap/guides/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](https://nuxtseo.com/docs/sitemap/guides/best-practices) guide for more information.

## [Next Steps](#next-steps)

You've successfully installed Nuxt Sitemap. Here's the recommended reading path:

1. **[Data Sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources)** - Understand where your sitemap URLs come from
2. **[Dynamic URLs](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls)** - Add URLs from a CMS or database
3. **[Best Practices](https://nuxtseo.com/docs/sitemap/guides/best-practices)** - Ensure your sitemap follows SEO guidelines

**Using other Nuxt modules?**

- [Nuxt I18n](https://nuxtseo.com/docs/sitemap/guides/i18n) - Automatic locale sitemaps
- [Nuxt Content](https://nuxtseo.com/docs/sitemap/guides/content) - Configure sitemap from markdown frontmatter

**Ready to deploy?** Check out [Submitting Your Sitemap](https://nuxtseo.com/docs/sitemap/guides/submitting-sitemap).

[Edit this page](https://github.com/nuxt-modules/sitemap/edit/main/docs/content/0.getting-started/1.installation.md)

[Markdown For LLMs](https://nuxtseo.com/docs/sitemap/getting-started/installation.md)

Did this page help you?

### Related

[Data Sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources) [Nuxt Robots](https://nuxtseo.com/docs/robots/getting-started/installation) [Nuxt Site Config](https://nuxtseo.com/docs/site-config/getting-started/installation)

[Introduction Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.](https://nuxtseo.com/docs/sitemap/getting-started/introduction) [Data Sources Understand where your sitemap URLs come from.](https://nuxtseo.com/docs/sitemap/getting-started/data-sources)

On this page

- [Setup Module](#setup-module)
- [Verifying Installation](#verifying-installation)
- [Configuration](#configuration)
- [Next Steps](#next-steps)

[GitHub](https://github.com/harlan-zw/nuxt-seo) [ Discord](https://discord.com/invite/275MBUBvgP)

### [NuxtSEO](https://nuxtseo.com/ "Home")

- [Getting Started](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)
- [MCP](https://nuxtseo.com/docs/nuxt-seo/guides/mcp)

Modules

- [Robots](https://nuxtseo.com/docs/robots/getting-started/introduction)
- [Sitemap](https://nuxtseo.com/docs/sitemap/getting-started/introduction)
- [OG Image](https://nuxtseo.com/docs/og-image/getting-started/introduction)
- [Schema.org](https://nuxtseo.com/docs/schema-org/getting-started/introduction)
- [Link Checker](https://nuxtseo.com/docs/link-checker/getting-started/introduction)
- [SEO Utils](https://nuxtseo.com/docs/seo-utils/getting-started/introduction)
- [Site Config](https://nuxtseo.com/docs/site-config/getting-started/introduction)
- [Skew Protection](https://nuxtseo.com/docs/skew-protection/getting-started/introduction)
- [AI Ready](https://nuxtseo.com/docs/ai-ready/getting-started/introduction)

### [NuxtSEO Pro](https://nuxtseo.com/pro "Home")

- [Getting Started](https://nuxtseo.com/pro)
- [Dashboard](https://nuxtseo.com/pro/dashboard)
- [Pro MCP](https://nuxtseo.com/docs/nuxt-seo-pro/mcp/installation)

### [Learn SEO](https://nuxtseo.com/learn-seo "Learn SEO")

Nuxt

- [Mastering Meta](https://nuxtseo.com/learn-seo/nuxt/mastering-meta)
- [Controlling Crawlers](https://nuxtseo.com/learn-seo/nuxt/controlling-crawlers)
- [Launch & Listen](https://nuxtseo.com/learn-seo/nuxt/launch-and-listen)
- [Routes & Rendering](https://nuxtseo.com/learn-seo/nuxt/routes-and-rendering)
- [Staying Secure](https://nuxtseo.com/learn-seo/nuxt/routes-and-rendering/security)

Vue

- [Vue SEO Guide](https://nuxtseo.com/learn-seo/vue)
- [Mastering Meta](https://nuxtseo.com/learn-seo/vue/mastering-meta)
- [Controlling Crawlers](https://nuxtseo.com/learn-seo/vue/controlling-crawlers)
- [SPA SEO](https://nuxtseo.com/learn-seo/vue/spa)
- [SSR Frameworks](https://nuxtseo.com/learn-seo/vue/ssr-frameworks)
- [SEO Checklist](https://nuxtseo.com/learn-seo/checklist)
- [Pre-Launch Warmup](https://nuxtseo.com/learn-seo/pre-launch-warmup)
- [Backlinks & Authority](https://nuxtseo.com/learn-seo/backlinks)

### [Tools](https://nuxtseo.com/tools "SEO Tools")

- [Social Share Debugger](https://nuxtseo.com/tools/social-share-debugger)
- [Robots.txt Generator](https://nuxtseo.com/tools/robots-txt-generator)
- [Meta Tag Checker](https://nuxtseo.com/tools/meta-tag-checker)
- [HTML to Markdown](https://nuxtseo.com/tools/html-to-markdown)
- [XML Sitemap Validator](https://nuxtseo.com/tools/xml-sitemap-validator)
- [Schema.org Validator](https://nuxtseo.com/tools/schema-validator)
- [Keyword Idea Generator](https://nuxtseo.com/tools/keyword-generator)
- [Keyword Research](https://nuxtseo.com/tools/keyword-research)
- [SERP Analyzer](https://nuxtseo.com/tools/serp-analyzer)
- [Domain Rankings](https://nuxtseo.com/tools/domain-rankings)

Copyright © 2023-2026 Harlan Wilton - [MIT License](https://github.com/harlan-zw/nuxt-seo/blob/main/license) · [mdream](https://mdream.dev)