---
title: "Config"
description: "Configure the sitemap module."
canonical_url: "https://nuxtseo.com/docs/sitemap/api/config"
last_updated: "2026-07-24T04:47:35.842Z"
---

## `enabled: boolean`

- Default: `true`

Whether to generate the sitemap.

## `sortEntries: 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: SitemapSource[]`

- Default: `[]`

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

## `excludeAppSources: true | AppSourceContext[]`

- Default: `[]`

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

## `appendSitemaps: (string | { sitemap: string, lastmod?: string })[]`

- Default: `undefined`

Sitemaps to append to the sitemap index.

This will only do anything when using multiple sitemaps.

## `autoLastmod: boolean`

- Default: `false`

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

## `sitemaps: boolean | Record<string, SitemapConfig> & { index?: (string | SitemapIndexEntry)[] }`

- Default: `false`

Whether to generate multiple sitemaps.

Each sitemap can have the following options:

### `sources: SitemapSource[]`

- Default: `[]`

Data sources for this specific sitemap.

### `chunks: 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.

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

### `chunkSize: number`

- Default: `undefined`

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

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

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

### `urls: SitemapUrlInput[] | (() => SitemapUrlInput[] | Promise<SitemapUrlInput[]>)`

- Default: `[]`

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

### `include: (string | RegExp | { regex: string })[]`

- Default: `undefined`

Filter URLs to include in this sitemap.

### `exclude: (string | RegExp | { regex: string })[]`

- Default: `undefined`

Filter URLs to exclude from this sitemap.

### `defaults: SitemapItemDefaults`

- Default: `{}`

Default values for all URLs in this sitemap.

### `includeAppSources: boolean`

- Default: `false`

Whether to include automatic app sources in this sitemap.

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

## `defaultSitemapsChunkSize: 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.

```ts [nuxt.config.ts]
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: object`

- Default: `{}`

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

## `urls: MaybeFunction<MaybePromise<SitemapUrlInput[]>>`

- Default: `[]`

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

## `include: (string | RegExp | { regex: string })[]`

- Default: `[]`

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

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

## `exclude: (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](/docs/sitemap/guides/filtering-urls) guide for details.

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

## `xsl: string | false`

- Default: `/__sitemap__/style.xsl`

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

## `discoverImages: boolean`

- Default: `true`

Whether to discover images from routes when prerendering.

## `discoverVideos: boolean`

- Default: `true`

Whether to discover videos from routes when prerendering.

## `autoI18n: 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: 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: 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: number | false`

- Default: `60 * 10`

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

## `sitemapsPathPrefix: string | false`

- Default: `/__sitemap__/`

The path prefix for the sitemaps when using multiple sitemaps.

## `runtimeCacheStorage: boolean | (Record<string, any> & { driver: string })`

- Default: `true`

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

## `xslColumns: ({ label: string; width: `${string}%`; select?: string })[]`

- Default:

```json
[
  { "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: boolean`

- Default: `true`

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

## `experimentalWarmUp: boolean`

- Default: `false`

Whether to warm up the sitemaps when Nitro starts. This can be useful for large sitemaps.

## `experimentalCompression: boolean`

- Default: `false`

Whether to stream gzip or deflate compression when the request accepts it. This streams the transport even when XML serialization is buffered. Combine it with `experimentalStreaming` to stream both serialization and compression.

## `experimentalStreaming: boolean`

- Default: `false`

Whether to serialize dynamic sitemap and sitemap index responses as a pull-driven stream. URL sources and the finalized URL plan are still resolved in full before serialization begins. Streaming a source response does not make source processing incremental.

Prerendered output remains buffered. Accessing `ctx.sitemap` from the `sitemap:output` hook buffers that response for backwards compatibility. Enable `debug` to expose the `X-Sitemap-Render-Mode` response header. See the [performance guide](/docs/sitemap/advanced/performance#verify-the-render-mode) for constraints and verification.

## `credits: boolean`

- Default: `true`

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

## `minify: boolean`

- Default: `false`

Whether to minify the sitemap.xml.

## `debug: 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](/docs/sitemap/getting-started/troubleshooting) guide for details.

## `zeroRuntime: 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](/docs/sitemap/guides/zero-runtime) guide for details.
