Sitemap
Guides

Route Rules

Configure your sitemap entries with route rules.

To change the behavior of your sitemap URLs, you can use Route rules.

When doing so, you can provide either robots: false as a shortcut or a full sitemap object, see Sitemap URL Schema.

Either through your nuxt config file using pattern matching.

nuxt.config.ts
export default defineNuxtConfig({
  routeRules: {
    // Don't add any /secret/** URLs to the sitemap.xml
    '/secret/**': { robots: false },
    // modify the sitemap.xml entry for specific URLs
    '/about': { sitemap: { changefreq: 'daily', priority: 0.3 } }
  }
})

Alternatively, you can use the defineRouteRules helper on specific pages.

pages/index.vue
<script setup>
defineRouteRules({
  sitemap: {
    changefreq: 'daily',
    priority: 0.3
  }
})
</script>