# Nuxt XML sitemap

> Set up a Nuxt sitemap for SSR or static hosting, include real public routes, and verify the deployed XML before submitting it.

Canonical: https://scaplet.com/seo/nuxt/xml-sitemap

Guide Nuxt Nuxt · XML sitemap

Set up a Nuxt sitemap for SSR or static hosting, include real public routes, and verify the deployed XML before submitting it.

4 min

read

5

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

Install `@nuxtjs/sitemap` with `npx nuxt module add sitemap`, set your production site URL, then inspect the generated sitemap and any split files. Module v9 requires Nuxt 4.6 or later; older Nuxt needs an earlier module line. For a custom route, prerender it if you deploy statically. List canonical, public pages only and verify each URL on the deployed domain.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnuxt%2Fxml-sitemap%20(%22Nuxt%20XML%20sitemap%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnuxt%2Fxml-sitemap%20(%22Nuxt%20XML%20sitemap%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnuxt%2Fxml-sitemap%20(%22Nuxt%20XML%20sitemap%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnuxt%2Fxml-sitemap%20(%22Nuxt%20XML%20sitemap%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 4 minutes.

1. [Choose a sitemap approach for this Nuxt project 01](#choose-a-sitemap-approach-for-this-nuxt-project)
2. [Install and confirm the generated sitemap 02](#install-and-confirm-the-generated-sitemap)
3. [Audit coverage and keep the index useful 03](#audit-coverage-and-keep-the-index-useful)

_01_Your rendering setup determines how the sitemap is served

## Choose a sitemap approach for this Nuxt project

Setup

### Nuxt 4.6+ or Nuxt 5 app

Starting point

Use the current `@nuxtjs/sitemap` module (v9)

Critical check

Check module output for routes from the CMS and runtime data

Setup

### Nuxt 3 or an older Nuxt 4 release

Starting point

Install an earlier module line (npm tags `latest-8` and `latest-7` exist) and read its requirements first

Critical check

Do not assume v9 installs; its `package.json` requires Nuxt `^4.6.0 || ^5.0.0`

Setup

### Nuxt Content site

Starting point

Use the module's Nuxt Content integration (the Nuxt Content v2 sitemap recipe is legacy)

Critical check

Verify document paths use the production hostname and public route format

Setup

### Static generation with a custom server route

Starting point

Add `/sitemap.xml` to Nitro prerender routes

Critical check

Confirm the XML file exists in generated output and is served by the host

Setup

### Nuxt 2

Starting point

Use the legacy `nuxt-community/sitemap-module` documentation

Critical check

Do not copy Nuxt 3/4 module configuration into a Nuxt 2 app

The current Nuxt module supports one sitemap or multiple named sitemaps, and can fetch URLs from other sources. If you have custom routes or a [headless CMS](/glossary/headless-cms), map the public URL inventory deliberately rather than assuming the router knows every record.

_02_How it works

## Install and confirm the generated sitemap

1. 1

### Add the current module

From a Nuxt 4.6 or later project, run `npx nuxt module add sitemap`. The v9 module also requires Node 22.22.3 or later, 24.15.0 or later, or 26 or later. Use the Nuxt 2 module documentation if your project is on Nuxt 2.
2. 2

### Set the production site URL

The module requires a site URL at minimum: set `site: { url: 'https://example.com' }` in `nuxt.config.ts` or `NUXT_SITE_URL` in the environment. Without one, the module docs say the sitemap uses localhost in production. Keep preview and local domains out of generated URLs.
3. 3

### Build using production mode

Generate a production build and inspect `/sitemap.xml` or the index and child files the module creates. Development output does not prove the production host serves the same files.
4. 4

### Submit and inspect processing

Open the deployed sitemap without authentication, then submit its index in the matching [Search Console](/glossary/google-search-console) property and review fetch errors. Also add it to [robots.txt](/glossary/robots-txt); the module docs recommend the Nuxt Robots module for that.

Prerender a custom sitemap route

```
export default defineNuxtConfig({ nitro: { prerender: { routes: ['/sitemap.xml'] } } })
```

**A server route is not automatically a static file**The legacy Nuxt Content v2 sitemap recipe builds `/sitemap.xml` as a server route. It says that with `nuxt generate` the route cannot run on static hosting, so prerender it with `nitro.prerender.routes`.

_03_How it works

## Audit coverage and keep the index useful

- Include canonical URLs that return a successful response. Remove drafts, preview URLs, private pages, and redirects to another [canonical URL](/glossary/canonical-url).
- For dynamic catalog or CMS routes, provide the route list or data fetch the sitemap generator needs; a sitemap only includes URLs the integration can discover. The module's dynamic URL guide describes a runtime endpoint that returns a JSON array of objects with a `loc` field and optional `lastmod`, `changefreq`, and `priority`.
- For localized sites, verify each language URL and its reciprocal alternate annotations. Do not list locale variants that show duplicate or fallback content.
- Use accurate modification dates only when your content source tracks real changes. A generated build date is not a substitute for page-level `lastmod`.
- If a site exceeds sitemap protocol limits, split it into child sitemaps and expose a [sitemap index](/glossary/xml-sitemap). Google allows up to 50,000 URLs or 50 MB uncompressed per sitemap file.

See the [Nuxt sitemap module](https://nuxt.com/modules/sitemap), the [legacy Nuxt Content v2 sitemap recipe](https://v2.content.nuxt.com/recipes/sitemap), [Google's sitemap guide](/glossary/xml-sitemap), and [Search Console sitemap submission](/seo/google-search-console/sitemap-submission).

1. 01

### Compare routes with the source inventory

Sample static, CMS, localized, and dynamic pages. Confirm each important public route appears once and has the expected canonical URL.
2. 02

### Request every sitemap file

Fetch the deployed index and each child file. Check status, XML validity, host, redirects, and robots access.
3. 03

### Use Search Console for failures

A submitted sitemap helps discovery but does not guarantee indexing. If a listed page is missing from search, inspect canonical selection, crawl access, and page value separately.

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ Which sitemap module should I use with Nuxt?

Use `@nuxtjs/sitemap`. Its v9 release requires Nuxt 4.6 or later, and Nuxt's module page points Nuxt 2 users to the legacy `nuxt-community/sitemap-module` documentation.

_02_ Why is my Nuxt sitemap missing CMS pages?

The sitemap must be given or able to fetch those URLs. Check the module's data sources and confirm the CMS pages are published with canonical production paths.

_03_ Will a Nuxt server route work on static hosting?

Only if it is generated as a static route or your host runs the server output. The legacy Nuxt Content v2 recipe says to add the sitemap route to Nitro [prerendering](/glossary/speculation-rules) when using `nuxt generate`.

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- nuxt.com
- nuxtseo.com
- google.com

1. 01 [@nuxtjs/sitemap | Nuxt Modules](https://nuxt.com/modules/sitemap) nuxt.com · checked 2026-10-24
2. 02 [Install Nuxt Sitemap | Nuxt SEO](https://nuxtseo.com/docs/sitemap/getting-started/installation) nuxtseo.com · checked 2026-10-24
3. 03 [Dynamic URL Endpoints | Nuxt Sitemap](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls) nuxtseo.com · checked 2026-10-24
4. 04 [Sitemap recipe | Nuxt Content v2 (legacy)](https://v2.content.nuxt.com/recipes/sitemap) v2.content.nuxt.com · checked 2026-10-24
5. 05 [Build and submit a sitemap | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap) developers.google.com · checked 2026-10-24

## Keep learning

[All platform guides](/seo)

[Learn Nuxt SEO Frameworks](/seo/nuxt) [Related XML sitemap Crawling and indexing](/glossary/xml-sitemap) [Read next Next.js XML sitemap Frameworks](/seo/nextjs/xml-sitemap) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Nuxt SEO](/seo/nuxt) [Rank Math SEO plugin setup](/seo/rank-math/seo) [React lazy loading and SEO](/seo/react/lazy-loading)

More in Nuxt SEO
[Nuxt redirects](/seo/nuxt/redirects) [Nuxt XML sitemap](/seo/nuxt/xml-sitemap)

Terms on this page
[Headless CMS](/glossary/headless-cms) [Google Search Console](/glossary/google-search-console) [robots.txt](/glossary/robots-txt) [Canonical URL](/glossary/canonical-url) [XML sitemap](/glossary/xml-sitemap) [Speculation rules](/glossary/speculation-rules)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
