Production generated route
- Sitemap behavior
- Included by the sitemap plugin
- What to verify
- It should return the intended public page
Check the classic preset, production sitemap path, baseUrl, noindex filtering, and missing routes in Docusaurus.
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.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
@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: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/.
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.
Run the production build. The plugin is inactive in development because it operates on the build output.
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.
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.
noIndex enabledignorePatterns 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.
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.
Confirm it is valid XML, uses the canonical HTTPS host, and lists only indexable URLs. Check whether your deployment adds a path prefix.
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.
Submit the production sitemap in the matching Search Console property and check the Sitemaps report for errors.
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.
3 questions people ask next, answered from the sources on this page.
Yes, when using @docusaurus/preset-classic, which includes the official sitemap plugin. It generates the sitemap during a production build.
It is available at [baseUrl]/sitemap.xml under your configured url after the production build.
Check whether the route is generated, whether noindex metadata or site noIndex excludes it, and whether ignorePatterns or a custom sitemap callback filters it.
Run the free audit, then approve the fixes. Every change can be undone.