Free auditStart free
GuideNuxt · XML sitemap

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 withChatGPTClaudePerplexityGoogleAI Mode
01Your 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, map the public URL inventory deliberately rather than assuming the router knows every record.

02How 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 property and review fetch errors. Also add it to 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']
    }
  }
})
03How 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.
  • 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. Google allows up to 50,000 URLs or 50 MB uncompressed per sitemap file.

See the Nuxt sitemap module, the legacy Nuxt Content v2 sitemap recipe, Google's sitemap guide, and 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.

01Which 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.

02Why 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.

03Will 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 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 Modulesnuxt.com · checked 2026-10-24
  2. 02Install Nuxt Sitemap | Nuxt SEOnuxtseo.com · checked 2026-10-24
  3. 03Dynamic URL Endpoints | Nuxt Sitemapnuxtseo.com · checked 2026-10-24
  4. 04Sitemap recipe | Nuxt Content v2 (legacy)v2.content.nuxt.com · checked 2026-10-24
  5. 05Build and submit a sitemap | Google Search Centraldevelopers.google.com · checked 2026-10-24
Free · 2 minutes

Tools point. Agencies advise. This one ships.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane