Robots
Guides

Disabling Page Indexing

Learn how to disable indexing for specific pages on your app.

When disabling indexing for specific pages, you have a few options.

Route Rules

If you have a static page that you want to disable indexing for, you can use defineRouteRules (requires enabling the experimental inlineRouteRules).

pages/about.vue
<script lang="ts" setup>
defineRouteRules({
  robots: false,
})
</script>

For more complex scenarios see the Route Rules guide.

Robots.txt

To configure blocked URLs using a robots.txt file, simply use the Disallow directive.

// public/_robots.txt
User-agent: *
Disallow: /my-page
Disallow: /secret/*

Nuxt Config

If you need finer programmatic control, you can configure the module using nuxt.config.

nuxt.config.ts
export default defineNuxtConfig({
  robots: {
    disallow: ['/secret', '/admin'],
  }
})

See the Nuxt Config guide for more details.