Free auditStart free
GuideDocusaurus · XML sitemap

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 withChatGPTClaudePerplexityGoogleAI Mode
01How 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 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.

03How 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, the XML sitemap definition, and noindex.

  1. 01

    Parse the production sitemap

    Confirm it is valid XML, uses the canonical HTTPS host, and lists only indexable 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.

  3. 03

    Submit the sitemap

    Submit the production sitemap in the matching 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.

01Does 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.

02Where is the Docusaurus sitemap?

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

03Why 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. 01Search engine optimization (SEO) | Docusaurusdocusaurus.io · checked 2026-10-24
  2. 02plugin-sitemap | Docusaurusdocusaurus.io · checked 2026-10-24
  3. 03Learn about sitemaps | Google Search Centraldevelopers.google.com · checked 2026-10-24
Free · 2 minutes

Tools point. Agencies advise. This one ships.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane