---
title: "Disable Page Indexing"
description: "Learn how to disable indexing for specific pages on your app."
canonical_url: "https://nuxtseo.com/docs/robots/guides/disable-page-indexing"
last_updated: "2026-05-25T04:25:52.387Z"
---

## Introduction

As not all sites are the same, it's important for you to have a flexible way to disable indexing for specific pages.

The best options to choose are either:

- [Robots.txt](#robotstxt) - Great for blocking robots from accessing specific pages that haven't been indexed yet.
- [useRobotsRule](#userobotsrule) - Controls the `<meta name="robots" content="...">` meta tag and `X-Robots-Tag` HTTP Header. Useful for dynamic pages where you may not know if it should be indexed at build time and when you need to remove pages from search results. For example, a user profile page that should only be indexed if the user has made their profile public.
- [Page Meta](#page-meta) - Set robots rules directly in `definePageMeta` for static, per-page configuration at build time.

If you're still unsure about which option to choose, make sure you read the [Controlling Web Crawlers](/learn-seo/nuxt/controlling-crawlers) guide.

<learn-label icon="i-ph-robot-duotone" label="Conquering Web Crawlers" to="/learn-seo/nuxt/controlling-crawlers">



</learn-label>

[Route Rules](#route-rules) and [Nuxt Config](#nuxt-config) are also available for more complex scenarios.

## Robots.txt

Please follow the [Config using Robots.txt](/docs/robots/guides/robots-txt) guide to configure your `robots.txt` file.

You'll be able to use the `Disallow` directive within a `robots.txt` file to block specific URLs.

```robots-txt [public/_robots.txt]
User-agent: *
Disallow: /my-page
Disallow: /secret/*
```

## useRobotsRule

The [useRobotsRule](/docs/robots/api/use-robots-rule) composable provides a reactive way to access and set the robots rule at runtime.

```ts
import { useRobotsRule } from '#imports'

// Using string syntax
const rule = useRobotsRule()
rule.value = 'noindex, nofollow'

// Using object syntax (recommended)
useRobotsRule({ noindex: true, nofollow: true })

// Combining with AI-specific directives
useRobotsRule({
  noindex: true,
  noai: true, // Prevent AI crawlers from using content
  noimageai: true // Prevent AI crawlers from using images
})
```

## Page Meta

You can set robots rules directly in [definePageMeta](https://nuxt.com/docs/api/utils/define-page-meta). This is extracted at build time and converted into route rules.

```vue [pages/hidden.vue]
<script lang="ts" setup>
definePageMeta({
  robots: false,
})
</script>
```

This supports the same values as [Route Rules](/docs/robots/guides/route-rules): `boolean`, `string`, or an object of directives.

```vue [pages/ai-protected.vue]
<script lang="ts" setup>
definePageMeta({
  robots: { noindex: true, noai: true },
})
</script>
```

<note>

For dynamic conditions where the robots value depends on runtime data (e.g. a user's profile visibility), prefer [useRobotsRule](#userobotsrule) instead.

</note>

## Route Rules

You can also use [defineRouteRules](https://nuxt.com/docs/api/utils/define-route-rules) (requires enabling the experimental `inlineRouteRules`).

This is a build-time configuration that will generate the appropriate rules in the `/robots.txt` file and is integrated with the [Sitemap](/docs/sitemap/guides/filtering-urls) module.

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

For more complex scenarios see the [Route Rules](/docs/robots/guides/route-rules) guide.

## Nuxt Config

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

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

See the [Nuxt Config](/docs/robots/guides/nuxt-config) guide for more details.
