# Docusaurus XML sitemap

> Check the classic preset, production sitemap path, baseUrl, noindex filtering, and missing routes in Docusaurus.

Canonical: https://scaplet.com/seo/docusaurus/xml-sitemap

Guide Docusaurus · XML sitemap

Check the classic preset, production sitemap path, baseUrl, noindex filtering, and missing routes in Docusaurus.

3 min

read

3

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

Docusaurus’s classic preset ships with `@docusaurus/plugin-sitemap`, which creates `sitemap.xml` at `[baseUrl]/sitemap.xml` after a production build, using the configured `url`. Check the public origin, filter routes that should not be indexed, build, and verify the deployed XML and listed URLs. A sitemap helps discovery but does not guarantee indexing.

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fdocusaurus%2Fxml-sitemap%20(%22Docusaurus%20XML%20sitemap%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fdocusaurus%2Fxml-sitemap%20(%22Docusaurus%20XML%20sitemap%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fdocusaurus%2Fxml-sitemap%20(%22Docusaurus%20XML%20sitemap%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fdocusaurus%2Fxml-sitemap%20(%22Docusaurus%20XML%20sitemap%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 3 minutes.

1. [Use the sitemap plugin already in the classic preset 01](#use-the-sitemap-plugin-already-in-the-classic-preset)
2. [Control which Docusaurus routes appear 02](#control-which-docusaurus-routes-appear)
3. [Validate the file and fix missing URLs 03](#validate-the-file-and-fix-missing-urls)

_01_How it works

## Use the sitemap plugin already in the classic preset

Most new Docusaurus sites use `@docusaurus/preset-classic`, which includes the official sitemap plugin. You generally do not need to install it separately. Configure the site’s public origin and base path in `docusaurus.config.js` or `docusaurus.config.ts`:

1. 1

### Set the production URL

Set `url` to the canonical [HTTPS](/glossary/https) origin, such as `https://docs.example.com`. Use `baseUrl` for a path prefix only when the site is actually deployed below one, such as `/docs/`.
2. 2

### Keep the plugin enabled

If you use the classic preset, leave its `sitemap` option enabled. For a custom preset or plugin list, install and configure `@docusaurus/plugin-sitemap` explicitly.
3. 3

### Build for production

Run the production build. The plugin is inactive in development because it operates on the build output.
4. 4

### Open the generated file

Check the built `sitemap.xml` under the output directory, then open `https://docs.example.com/[baseUrl]/sitemap.xml` after deploy, as Docusaurus’s SEO guide describes.

docusaurus.config.js

```
export default { url: "https://docs.example.com", baseUrl: "/", presets: [ ["@docusaurus/preset-classic", { sitemap: { lastmod: "date", ignorePatterns: ["/tags/**"], }, }], ], };
```

If your main site and docs use separate hosts, each host needs a correct public URL and sitemap strategy. Keep the sitemap’s host and protocol aligned with the canonical page URLs.

_02_What the plugin includes or filters

## Control which Docusaurus routes appear

Route condition

### Production generated route

Sitemap behavior

Included by the sitemap plugin

What to verify

It should return the intended public page

Route condition

### Page with a robots [noindex directive](/glossary/noindex)

Sitemap behavior

Filtered automatically (documented in the SEO guide)

What to verify

Inspect the rendered page metadata

Route condition

### Site config `noIndex` enabled

Sitemap behavior

Sitemap is not generated

What to verify

Remove this setting for a site intended to appear in search

Route condition

### Route beneath a configured baseUrl

Sitemap behavior

URL includes the base path

What to verify

Check for duplicated or missing path prefixes

Route condition

### Route not generated by a plugin/build

Sitemap behavior

Cannot be emitted as a generated page URL

What to verify

Check the build route inventory

`ignorePatterns` takes glob patterns matched against route paths, and Docusaurus notes you may need to include the base URL. `createSitemapItems` is an optional function to transform or filter items. `filename` (default `sitemap.xml`) changes the output file, and the site's `trailingSlash` setting decides whether sitemap URLs end in a slash. Inspect the built XML before trusting a pattern.

**lastmod needs real route metadata**The `lastmod` option defaults to `null` (disabled). Set it to `'date'` (YYYY-MM-DD) or `'datetime'` (ISO 8601); the plugin then outputs `<lastmod>` only for routes whose metadata includes `sourceFilePath` or `lastUpdatedAt`. Official content plugins provide that for routes backed by a content file; third-party plugins may not. Defaults for `changefreq` and `priority` are `'weekly'` and `0.5`, and Google ignores both.

_03_How it works

## Validate the file and fix missing URLs

Google says a sitemap should list the canonical URLs you prefer, which you can use to influence the canonical URL it shows. A sitemap helps discovery but does not guarantee that every listed URL is crawled and indexed. See [sitemap submission](/seo/google-search-console/sitemap-submission), the [XML sitemap definition](/glossary/xml-sitemap), and [noindex](/glossary/noindex).

1. 01

### Parse the production sitemap

Confirm it is valid XML, uses the canonical HTTPS host, and lists only [indexable](/glossary/indexability) URLs. Check whether your deployment adds a path prefix.
2. 02

### Sample important route families

Check a documentation page, blog post, localized URL, and any custom route. Each listed URL should return a successful page and use its [canonical URL](/glossary/canonical-url).
3. 03

### Submit the sitemap

Submit the production sitemap in the matching [Search Console](/glossary/google-search-console) property and check the Sitemaps report for errors.
4. 04

### Trace a missing page

If a URL is absent, confirm the route is generated in production, check for noindex metadata and `ignorePatterns`, and inspect plugin configuration. If it is listed but not indexed, use URL Inspection to diagnose the page.

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ Does Docusaurus create a sitemap by default?

Yes, when using `@docusaurus/preset-classic`, which includes the official sitemap plugin. It generates the sitemap during a production build.

_02_ Where is the Docusaurus sitemap?

It is available at `[baseUrl]/sitemap.xml` under your configured `url` after the production build.

_03_ Why is a Docusaurus page missing from sitemap.xml?

Check whether the route is generated, whether noindex metadata or site `noIndex` excludes it, and whether `ignorePatterns` or a custom sitemap callback filters it.

Sources · 3

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- docusaurus.io
- google.com

1. 01 [Search engine optimization (SEO) | Docusaurus](https://docusaurus.io/docs/seo) docusaurus.io · checked 2026-10-24
2. 02 [plugin-sitemap | Docusaurus](https://docusaurus.io/docs/api/plugins/%40docusaurus/plugin-sitemap) docusaurus.io · checked 2026-10-24
3. 03 [Learn about sitemaps | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview) developers.google.com · checked 2026-10-24

## Keep learning

[All platform guides](/seo)

[Learn Docusaurus AI crawlers and robots.txt Docs platforms](/seo/docusaurus/ai-crawlers) [Related Google Search Console Crawling and indexing](/glossary/google-search-console) [Read next Astro robots.txt Frameworks](/seo/astro/robots-txt) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Django custom 404 page](/seo/django/404) [Drupal SEO](/seo/drupal) [Drupal maintenance mode and SEO](/seo/drupal/maintenance-mode)

More in Docs platforms
[Docusaurus AI crawlers and robots.txt](/seo/docusaurus/ai-crawlers) [Docusaurus XML sitemap](/seo/docusaurus/xml-sitemap)

Terms on this page
[HTTPS](/glossary/https) [Noindex](/glossary/noindex) [Indexability](/glossary/indexability) [Canonical URL](/glossary/canonical-url) [Google Search Console](/glossary/google-search-console) [XML sitemap](/glossary/xml-sitemap)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
