Skip to content

Discoverability · Nuxt

How to add a sitemap.xml in Nuxt

A sitemap is how you tell a search engine which pages exist and when they last changed, rather than waiting for every one of them to be found by following links. Without it, pages that are not linked prominently can go months before they are crawled at all.

The fix for Nuxt

13x detects your framework from the response and hands you this version rather than the generic one — below 50% confidence it hedges and gives you the generic one instead.

Use the sitemap module:

bash code
npx nuxi module add sitemap
ts code
// nuxt.config.ts
export default defineNuxtConfig({
  site: { url: "https://example.com" },
  modules: ["@nuxtjs/sitemap"],
});

On a different stack? The general version of this fix explains what 13x checks and why it matters, without assuming a framework.

Check your Nuxt site

113 deterministic checks against your live URL, in about 30 seconds. Framework detected from the response, so every fix comes back in the form your stack actually uses.

No signup. Results in 30 seconds.

The same fix, other stacks