Multi Sitemaps · 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.11

- Playgrounds
- [Discord Support](https://discord.com/invite/275MBUBvgP)

### Getting Started

- [Introduction](https://nuxtseo.com/docs/sitemap/getting-started/introduction)
- [Installation](https://nuxtseo.com/docs/sitemap/getting-started/installation)
- [Data Sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources)
- [Troubleshooting](https://nuxtseo.com/docs/sitemap/getting-started/troubleshooting)

### Core Concepts

- [Dynamic URL Endpoints](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls)
- [Disabling Indexing](https://nuxtseo.com/docs/sitemap/guides/filtering-urls)
- [Multi Sitemaps](https://nuxtseo.com/docs/sitemap/guides/multi-sitemaps)
- [I18n](https://nuxtseo.com/docs/sitemap/guides/i18n)
- [Nuxt Content](https://nuxtseo.com/docs/sitemap/guides/content)
- [Nuxt Prerendering](https://nuxtseo.com/docs/sitemap/guides/prerendering)
- [Best Practices](https://nuxtseo.com/docs/sitemap/guides/best-practices)
- [Submitting Your Sitemap](https://nuxtseo.com/docs/sitemap/guides/submitting-sitemap)
- [Zero Runtime](https://nuxtseo.com/docs/sitemap/guides/zero-runtime)

### Advanced

- [Lastmod, Priority, and Changefreq](https://nuxtseo.com/docs/sitemap/advanced/loc-data)
- [Images, Videos, News](https://nuxtseo.com/docs/sitemap/advanced/images-videos)
- [Sitemap Performance](https://nuxtseo.com/docs/sitemap/advanced/performance)
- [Sitemap Chunking](https://nuxtseo.com/docs/sitemap/advanced/chunking-sources)
- [Customising the UI](https://nuxtseo.com/docs/sitemap/advanced/customising-ui)

Core Concepts

# Multi Sitemaps

[Copy for LLMs](https://nuxtseo.com/docs/sitemap/guides/multi-sitemaps.md)

## [Introduction](#introduction)

By default, the module generates a single `/sitemap.xml` file, which works perfectly for most websites.

For larger sites with thousands of URLs, multiple sitemaps offer several benefits:

- Easier debugging and management
- More efficient search engine crawling
- Better organization of content types

## [Enabling Multiple Sitemaps](#enabling-multiple-sitemaps)

You can enable multiple sitemaps using the `sitemaps` option in two ways:

1. **Manual Chunking** (`object`): Best for sites with clear content types (pages, posts, etc) or fewer than 1000 URLs
2. **Automatic Chunking** (`true`): Best for sites with more than 1000 URLs without clear content types

Manual Chunking

Automatic Chunking

```
export default defineNuxtConfig({
  sitemap: {
    // manually chunk into multiple sitemaps
    sitemaps: {
      posts: {
        include: [
          '/blog/**',
        ],
        // example: give blog posts slightly higher priority (this is optional)
        defaults: { priority: 0.7 },
      },
      pages: {
        exclude: [
          '/blog/**',
        ]
      },
    },
  },
})
```

```
export default defineNuxtConfig({
  sitemap: {
    sitemaps: true,
    // modify the chunk size if you need
    defaultSitemapsChunkSize: 2000 // default 1000
  },
})
```

### [Customizing Sitemap URLs](#customizing-sitemap-urls)

By default, all multi-sitemaps are served under the `/__sitemap__/` prefix. You can customize this behavior to create cleaner URLs:

```
export default defineNuxtConfig({
  sitemap: {
    sitemapsPathPrefix: '/', // or false
    sitemaps: {
      // will be available at /sitemap-foo.xml
      'sitemap-foo': {
        // ...
      }
    }
  }
})
```

## [Manual Chunking](#manual-chunking)

Manual chunking gives you complete control over how your URLs are distributed across sitemaps. This approach is ideal when you have distinct content types or specific organizational needs.

### [Setting Default Values](#setting-default-values)

You can provide default values for URLs within each sitemap using the `defaults` option:

```
export default defineNuxtConfig({
  sitemap: {
    sitemaps: {
      posts: {
        // posts low priority
        defaults: { priority: 0.7 },
      },
    },
  },
})
```

### [Extending App Sources](#extending-app-sources)

When you already have all URLs in your single sitemap but want to split them into separate sitemaps, you can extend existing [app sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources) and apply filters.

Available options:

- `includeAppSources`: Include URLs from automatic app sources
- `include`: Array of glob patterns to include
- `exclude`: Array of glob patterns to exclude

nuxt.config.ts

```
export default defineNuxtConfig({
  sitemap: {
    sitemaps: {
      pages: {
        // extend the nuxt:pages app source
        includeAppSources: true,
        // filter the URLs to only include pages
        exclude: ['/blog/**'],
      },
      posts: {
        // extend the nuxt:pages app source
        includeAppSources: true,
        // filter the URLs to only include pages
        include: ['/blog/**'],
      },
    },
  },
})
```

#### [Using the `_sitemap` Key](#using-the-_sitemap-key)

When using global sources and need to direct specific URLs to particular sitemaps, use the `_sitemap` key:

nuxt.config.ts

server/api/sitemap-urls.ts

```
export default defineNuxtConfig({
  sitemap: {
    sources: [
      '/api/sitemap-urls'
    ],
    sitemaps: {
      pages: {
        includeAppSources: true,
        exclude: ['/**']
        // ...
      },
    },
  },
})
```

```
export default defineSitemapEventHandler(() => {
  return [
    {
      loc: '/about-us',
      // will end up in the pages sitemap
      _sitemap: 'pages',
    }
  ]
})
```

### [Managing Custom Sources](#managing-custom-sources)

For sitemaps that need to fetch URLs from endpoints, you have two options:

- `urls`: Static URLs to include in the sitemap (avoid for large URL sets)
- `sources`: Endpoints to fetch [dynamic URLs](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls) from (JSON or XML)

```
export default defineNuxtConfig({
  sitemap: {
    sitemaps: {
      posts: {
        urls() {
          // resolved when the sitemap is shown
          return ['/foo', '/bar']
        },
        sources: [
          '/api/sitemap-urls'
        ]
      },
    },
  },
})
```

### [Chunking Large Sources](#chunking-large-sources)

When you have sources that return a large number of URLs, you can enable chunking to split them into multiple XML files:

```
export default defineNuxtConfig({
  sitemap: {
    sitemaps: {
      posts: {
        sources: ['/api/posts'], // returns 10,000 posts
        chunks: true, // Enable chunking with default size (1000)
      },
      products: {
        sources: ['/api/products'], // returns 50,000 products
        chunks: 5000, // Chunk into files with 5000 URLs each
      },
      articles: {
        sources: ['/api/articles'],
        chunks: true,
        chunkSize: 2000, // Alternative way to specify chunk size
      }
    }
  },
})
```

This will generate:

- `/sitemap_index.xml` - Lists all sitemaps including chunks
- `/posts-0.xml` - First 1000 posts
- `/posts-1.xml` - Next 1000 posts
- `/products-0.xml` - First 5000 products
- `/products-1.xml` - Next 5000 products
- etc.

### [Linking External Sitemaps](#linking-external-sitemaps)

Use the special `index` key to add external sitemaps to your sitemap index:

```
export default defineNuxtConfig({
  sitemap: {
    sitemaps: {
      // generated sitemaps
      posts: {
        // ...
      },
      pages: {
        // ...
      },
      // extending the index sitemap with an external sitemap
      index: [
        { sitemap: 'https://www.google.com/sitemap-pages.xml' }
      ]
    }
  }
})
```

## [Automatic Chunking](#automatic-chunking)

Automatic chunking divides your sitemap into multiple files based on URL count. This feature:

- Uses numbered naming convention (`0.xml`, `1.xml`, etc.)
- Chunks based on `defaultSitemapsChunkSize` (default: 1000 URLs per sitemap)
- Should be avoided for sites with fewer than 1000 URLs

```
export default defineNuxtConfig({
  sitemap: {
    // automatically chunk into multiple sitemaps
    sitemaps: true,
    // optionally customize chunk size
    defaultSitemapsChunkSize: 2000 // default: 1000
  },
})
```

[Edit this page](https://github.com/nuxt-modules/sitemap/edit/main/docs/content/1.guides/2.multi-sitemaps.md)

[Markdown For LLMs](https://nuxtseo.com/docs/sitemap/guides/multi-sitemaps.md)

Did this page help you?

### Related

[Data Sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources) [Dynamic URL Endpoints](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls) [Sitemap Chunking](https://nuxtseo.com/docs/sitemap/advanced/chunking-sources) [Sitemap Performance](https://nuxtseo.com/docs/sitemap/advanced/performance)

[Disabling Indexing How to filter the URLs generated from application sources.](https://nuxtseo.com/docs/sitemap/guides/filtering-urls) [I18n Setting up a sitemap with Nuxt I18n and Nuxt I18n Micro.](https://nuxtseo.com/docs/sitemap/guides/i18n)

On this page

- [Introduction](#introduction)
- [Enabling Multiple Sitemaps](#enabling-multiple-sitemaps)
- [Manual Chunking](#manual-chunking)
- [Automatic Chunking](#automatic-chunking)

[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 Research Pro](https://nuxtseo.com/tools/keyword-research)
- [SERP Analyzer Pro](https://nuxtseo.com/tools/serp-analyzer)
- [Domain Rankings Pro](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)