---
title: "Config"
description: "Configure the sitemap module."
canonical_url: "https://nuxtseo.com/docs/sitemap/api/config"
last_updated: "2026-05-15T08:02:32.766Z"
---

## `enabled`

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

Whether to generate the sitemap.

## `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`

- Type: `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`

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

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

## `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`

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

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

## `sitemaps`

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

Whether to generate multiple sitemaps.

Each sitemap can have the following options:

### SitemapConfig

#### `sources`

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

Data sources for this specific sitemap.

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

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

#### `chunkSize`

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

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

```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`

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

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

#### `include`

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

Filter URLs to include in this sitemap.

#### `exclude`

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

Filter URLs to exclude from this sitemap.

#### `defaults`

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

Default values for all URLs in this sitemap.

#### `includeAppSources`

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

Whether to include automatic app sources in this sitemap.

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

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

```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`

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

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

## `urls`

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

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

## `include`

- Type: `(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
export default defineNuxtConfig({
  sitemap: {
    include: [
      '/my-hidden-url'
    ]
  }
})
```

## `exclude`

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

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

## `xsl`

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

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

## `discoverImages`

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

Whether to discover images from routes when prerendering.

## `discoverVideos`

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

Whether to discover videos from routes when prerendering.

## `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`

- 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`

- 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`

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

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

## `sitemapsPathPrefix`

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

The path prefix for the sitemaps when using multiple sitemaps.

## `runtimeCacheStorage`

- Type: `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`

- Type: `({ 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`

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

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

## `experimentalWarmUp`

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

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

## `experimentalCompression`

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

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

## `credits`

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

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

## `minify`

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

Whether to minify the sitemap.xml.

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

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