---
title: "Config Using Route Rules · Nuxt Robots · Nuxt SEO"
canonical_url: "https://nuxtseo.com/docs/robots/guides/route-rules"
last_updated: "2026-08-17T17:25:51.247Z"
meta:
  description: "Learn how to configure robots through route rules."
  "og:description": "Learn how to configure robots through route rules."
  "og:title": "Config Using Route Rules · Nuxt Robots · Nuxt SEO"
---

Nuxt SEO on GitHub

Switch to RobotsSwitch to Nuxt SEOSwitch to SitemapSwitch to OG ImageSwitch to Schema.orgSwitch to Link CheckerSwitch to SEO UtilsSwitch to Site ConfigSwitch to Skew ProtectionSwitch to AI Ready

**Core Concepts**

# **Config Using Route Rules**

If you prefer, you can use route rules to configure how your routes are indexed by search engines.

You can provide the following rules:

- `**{ robots: false }**` - Will disable the route from being indexed using the [**~~robotsDisabledValue~~**](https://nuxtseo.com/docs/robots/api/config#robotsdisabledvalue) config.
- `**{ robots: '<rule>' }**` - Will add the provided string as the robots rule
- `**{ robots: { /* directives */ } }**` - Will use object syntax to define robot directives

The rules are applied using the following logic:

- `**X-Robots-Tag**` header - SSR only
- `**<meta name="robots">**`
- `**/robots.txt**` disallow entry - When [**~~disallowNonIndexableRoutes~~**](https://nuxtseo.com/docs/robots/api/config#disallownonindexableroutes) is enabled

## Inline Route Rules

Requires enabling the experimental `**inlineRouteRules**`, see the [**~~defineRouteRules~~**](https://nuxt.com/docs/api/utils/define-route-rules) documentation to learn more.

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

## Nuxt Config

nuxt.config.ts

```ts
export default defineNuxtConfig({
  routeRules: {
    // use the `index` shortcut for simple rules
    '/secret/**': { robots: false },
    // add exceptions for individual routes
    '/secret/visible': { robots: true },
    // use the `robots` rule if you need finer control
    '/custom-robots': { robots: 'index, follow' },
    // use object syntax for more complex rules
    '/ai-protected': {
      robots: {
        index: true,
        noai: true,
        noimageai: true
      }
    },
    // control search result previews
    '/limited-preview': {
      robots: {
        'index': true,
        'max-image-preview': 'standard',
        'max-snippet': 100,
        'max-video-preview': 15
      }
    }
  }
})
```

**Was this page helpful?**

### **Related **

[**Config using Nuxt Config**](https://nuxtseo.com/docs/robots/guides/nuxt-config)

[**Nitro Hooks**](https://nuxtseo.com/docs/robots/nitro-api/nitro-hooks)

[**Disabling Indexing**](https://nuxtseo.com/docs/sitemap/guides/filtering-urls)

[**Config using Nuxt Config** Learn how to configure the module programmatically using nuxt.config.](https://nuxtseo.com/docs/robots/guides/nuxt-config) [**Disabling Site Indexing** Learn how to disable indexing for different environments and conditions to avoid crawling issues.](https://nuxtseo.com/docs/robots/guides/disable-indexing)