Config · 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)

### Nuxt API

- [nuxt.config.ts](https://nuxtseo.com/docs/sitemap/api/config)
- [Nuxt Hooks](https://nuxtseo.com/docs/sitemap/api/nuxt-hooks)

### Nitro API

- [Nitro Hooks](https://nuxtseo.com/docs/sitemap/nitro-api/nitro-hooks)

Nuxt API

# Config

[Copy for LLMs](https://nuxtseo.com/docs/sitemap/api/config.md)

## [`enabled`](#enabled)

- Type: `boolean`
- Default: `true`

Whether to generate the sitemap.

## [`sortEntries`](#sortentries)

- Type: `boolean`
- Default: `true`

Whether the sitemap entries should be sorted or be shown in the order they were added.

When enabled the entries will be sorted by the `loc`, they will be sorted by the path segment count and then alphabetically using `String.localeCompare` to ensure numbers are sorted correctly.

## [`sources`](#sources)

- Type: `SitemapSource[]`
- Default: `[]`

The sources to use for the sitemap. See [Data Sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources) and [Dynamic URL Endpoint](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls) for details.

## [`excludeAppSources`](#excludeappsources)

- Type: `true | AppSourceContext[]`
- Default: `[]`

Whether to exclude [app sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources) from the sitemap.

## [`appendSitemaps`](#appendsitemaps)

- Type: `(string| { sitemap: string, lastmod?: string})[]`
- Default: `undefined`

Sitemaps to append to the sitemap index.

This will only do anything when using multiple sitemaps.

## [`autoLastmod`](#autolastmod)

- Type: `boolean`
- Default: `false`

Sets the current date as the default `lastmod` for all entries that don't already have one.

## [`sitemaps`](#sitemaps)

- Type: `boolean | Record<string, SitemapConfig> & { index?: (string | SitemapIndexEntry)[] }`
- Default: `false`

Whether to generate multiple sitemaps.

Each sitemap can have the following options:

### [SitemapConfig](#sitemapconfig)

#### [`sources`](#sources-1)

- Type: `SitemapSource[]`
- Default: `[]`

Data sources for this specific sitemap.

#### [`chunks`](#chunks)

- Type: `boolean | number`
- Default: `undefined`

Enable chunking for sitemap sources. This splits large collections of URLs from sources into multiple smaller sitemap files to stay within search engine limits.

- Set to `true` to enable chunking with the default chunk size (from `defaultSitemapsChunkSize` or 1000)
- Set to a positive number to use that as the chunk size (e.g., `5000` for 5000 URLs per chunk)
- Set to `false` or leave undefined to disable chunking

Note: Chunking only applies to URLs from `sources`. Direct URLs in the `urls` property are not chunked.

```
export default defineNuxtConfig({
  sitemap: {
    sitemaps: {
      products: {
        sources: ['/api/products'],
        chunks: 5000 // Split into files with 5000 URLs each
      }
    }
  }
})
```

#### [`chunkSize`](#chunksize)

- Type: `number`
- Default: `undefined`

Explicitly set the chunk size for this sitemap. Takes precedence over the `chunks` property when both are specified.

```
export default defineNuxtConfig({
  sitemap: {
    sitemaps: {
      posts: {
        sources: ['/api/posts'],
        chunks: true, // Enable chunking
        chunkSize: 2500 // Use 2500 URLs per chunk
      }
    }
  }
})
```

See the [Chunking Sources](https://nuxtseo.com/docs/sitemap/advanced/chunking-sources) guide for more details.

#### [`urls`](#urls)

- Type: `SitemapUrlInput[] | (() => SitemapUrlInput[] | Promise<SitemapUrlInput[]>)`
- Default: `[]`

URLs to include in this sitemap. Can be strings or sitemap URL objects.

#### [`include`](#include)

- Type: `(string | RegExp | { regex: string })[]`
- Default: `undefined`

Filter URLs to include in this sitemap.

#### [`exclude`](#exclude)

- Type: `(string | RegExp | { regex: string })[]`
- Default: `undefined`

Filter URLs to exclude from this sitemap.

#### [`defaults`](#defaults)

- Type: `SitemapItemDefaults`
- Default: `{}`

Default values for all URLs in this sitemap.

#### [`includeAppSources`](#includeappsources)

- Type: `boolean`
- Default: `false`

Whether to include automatic app sources in this sitemap.

See [Multi Sitemaps](https://nuxtseo.com/docs/sitemap/guides/multi-sitemaps) for details.

## [`defaultSitemapsChunkSize`](#defaultsitemapschunksize)

- Type: `number | false`
- Default: `1000`

The default chunk size when chunking is enabled for multi-sitemaps. This value is used when:

- A sitemap has `chunks: true` (without specifying a number)
- No `chunkSize` is explicitly set for the sitemap

Set to `false` to disable chunking by default for all sitemaps.

```
export default defineNuxtConfig({
  sitemap: {
    defaultSitemapsChunkSize: 5000,
    sitemaps: {
      // These will use 5000 as chunk size
      posts: {
        sources: ['/api/posts'],
        chunks: true
      },
      // This overrides the default
      products: {
        sources: ['/api/products'],
        chunks: 10000
      }
    }
  }
})
```

## [`defaults`](#defaults-1)

- Type: `object`
- Default: `{}`

Default values for the sitemap.xml entries. See [sitemaps.org](https://www.sitemaps.org/protocol.html) for all available options.

## [`urls`](#urls-1)

- Type: `MaybeFunction<MaybePromise<SitemapUrlInput[]>>`
- Default: `[]`

Provide custom URLs to be included in the sitemap.xml.

## [`include`](#include-1)

- Type: `(string | RegExp | { regex: string })[]`
- Default: `[]`

Filter routes that match the given rules. If empty, all routes are included. See the [Filtering URLs](https://nuxtseo.com/docs/sitemap/guides/filtering-urls) guide for details.

```
export default defineNuxtConfig({
  sitemap: {
    include: [
      '/my-hidden-url'
    ]
  }
})
```

## [`exclude`](#exclude-1)

- Type: `(string | RegExp | { regex: string })[]`
- Default: `['/_**']`

Filter routes that match the given rules. The pattern `/_nuxt/**` is always added dynamically from `app.buildAssetsDir`, and `/__nuxt_content/**` is added when Nuxt Content v3 is detected. See the [Filtering URLs](https://nuxtseo.com/docs/sitemap/guides/filtering-urls) guide for details.

```
export default defineNuxtConfig({
  sitemap: {
    exclude: [
      '/my-secret-section/**'
    ]
  }
})
```

## [`xsl`](#xsl)

- Type: `string | false`
- Default: `/__sitemap__/style.xsl`

The path to the XSL stylesheet for the sitemap.xml. Set to `false` to disable.

## [`discoverImages`](#discoverimages)

- Type: `boolean`
- Default: `true`

Whether to discover images from routes when prerendering.

## [`discoverVideos`](#discovervideos)

- Type: `boolean`
- Default: `true`

Whether to discover videos from routes when prerendering.

## [`autoI18n`](#autoi18n)

- Type: `undefined | boolean | { locales: NormalisedLocales; defaultLocale: string; strategy: 'prefix' | 'prefix_except_default' | 'prefix_and_default' | 'no_prefix'; differentDomains?: boolean; pages?: Record<string, Record<string, string | false>> }`
- Default: `undefined`

Automatically add alternative language prefixes for each entry with the given prefixes. Set to `false` to disable.

When using the @nuxtjs/i18n module, this will automatically be set to the configured `locales` when left `undefined`.

## [`sitemapName`](#sitemapname)

- Type: `string`
- Default: `sitemap.xml`

Modify the name of the root sitemap.

Note: This only works when you're not using the multiple `sitemaps` option.

## [`strictNuxtContentPaths`](#strictnuxtcontentpaths)

- Type: `boolean`
- Default: `false`

Whether the paths within nuxt/content match their real paths. This is useful when you're using the `nuxt/content` module without documentDriven mode.

## [`cacheMaxAgeSeconds`](#cachemaxageseconds)

- Type: `number | false`
- Default: `60 * 10`

The time in seconds to cache the sitemaps. Set to `false` to disable caching.

## [`sitemapsPathPrefix`](#sitemapspathprefix)

- Type: `string | false`
- Default: `/__sitemap__/`

The path prefix for the sitemaps when using multiple sitemaps.

## [`runtimeCacheStorage`](#runtimecachestorage)

- Type: `boolean | (Record<string, any> & { driver: string })`
- Default: `true`

The storage engine to use for the cache. See [Performance](https://nuxtseo.com/docs/sitemap/advanced/performance) for details.

## [`xslColumns`](#xslcolumns)

- Type: `({ label: string; width: \`${string}%\`; select?: string })[]`
- Default:

```
[
  { "label": "URL", "width": "50%" },
  { "label": "Images", "width": "25%", "select": "count(image:image)" },
  { "label": "Last Updated", "width": "25%", "select": "concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))" }
]
```

The columns to display in the XSL stylesheet.

## [`xslTips`](#xsltips)

- Type: `boolean`
- Default: `true`

Whether to include tips on how to use the sitemap in the XSL stylesheet.

## [`experimentalWarmUp`](#experimentalwarmup)

- Type: `boolean`
- Default: `false`

Should the sitemaps be warmed up when Nitro starts. This can be useful for large sitemaps.

## [`experimentalCompression`](#experimentalcompression)

- Type: `boolean`
- Default: `false`

Should the sitemaps be compressed and streamed when the request accepts it.

## [`credits`](#credits)

- Type: `boolean`
- Default: `true`

Whether to include a comment on the sitemaps on how it was generated.

## [`minify`](#minify)

- Type: `boolean`
- Default: `false`

Whether to minify the sitemap.xml.

## [`debug`](#debug)

- Type: `boolean`
- Default: `false`

Enable to see debug logs and API endpoint.

The route at `/__sitemap__/debug.json` will be available in non-production environments.

See the [Troubleshooting](https://nuxtseo.com/docs/sitemap/getting-started/troubleshooting) guide for details.

## [`zeroRuntime`](#zeroruntime)

- Type: `boolean`
- Default: `false`

When enabled, sitemap generation only runs during prerendering. The sitemap building code is tree-shaken from the runtime bundle, reducing server bundle size by ~50KB.

Requires sitemaps to be prerendered. When enabled, `/sitemap.xml` is automatically added to `nitro.prerender.routes`.

See the [Zero Runtime](https://nuxtseo.com/docs/sitemap/guides/zero-runtime) guide for details.

[Edit this page](https://github.com/nuxt-modules/sitemap/edit/main/docs/content/4.api/0.config.md)

[Markdown For LLMs](https://nuxtseo.com/docs/sitemap/api/config.md)

Did this page help you?

[Customising the UI Change the look and feel of your sitemap.](https://nuxtseo.com/docs/sitemap/advanced/customising-ui) [Nuxt Hooks Build-time Nuxt hooks provided by @nuxtjs/sitemap.](https://nuxtseo.com/docs/sitemap/api/nuxt-hooks)

On this page

- [enabled](#enabled)
- [sortEntries](#sortentries)
- [sources](#sources)
- [excludeAppSources](#excludeappsources)
- [appendSitemaps](#appendsitemaps)
- [autoLastmod](#autolastmod)
- [sitemaps](#sitemaps)
- [defaultSitemapsChunkSize](#defaultsitemapschunksize)
- [defaults](#defaults-1)
- [urls](#urls-1)
- [include](#include-1)
- [exclude](#exclude-1)
- [xsl](#xsl)
- [discoverImages](#discoverimages)
- [discoverVideos](#discovervideos)
- [autoI18n](#autoi18n)
- [sitemapName](#sitemapname)
- [strictNuxtContentPaths](#strictnuxtcontentpaths)
- [cacheMaxAgeSeconds](#cachemaxageseconds)
- [sitemapsPathPrefix](#sitemapspathprefix)
- [runtimeCacheStorage](#runtimecachestorage)
- [xslColumns](#xslcolumns)
- [xslTips](#xsltips)
- [experimentalWarmUp](#experimentalwarmup)
- [experimentalCompression](#experimentalcompression)
- [credits](#credits)
- [minify](#minify)
- [debug](#debug)
- [zeroRuntime](#zeroruntime)

[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)