---
title: "getPathRobotConfig() · Nuxt Robots · Nuxt SEO"
canonical_url: "https://nuxtseo.com/docs/robots/nitro-api/get-path-robot-config"
last_updated: "2026-08-14T20:55:58.352Z"
meta:
  description: "See if a path is indexable within Nitro."
  "og:description": "See if a path is indexable within Nitro."
  "og:title": "getPathRobotConfig() · 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

**Nitro API**

# **getPathRobotConfig()**

## Introduction

The `**getPathRobotConfig()**` Nitro composable gives you access to the page robots config, allowing you to determine if the page can or can't be indexed and why.

This can be useful for disabling certain SEO features when the page does not allow for indexing. For example, Nuxt SEO uses this internally to disable OG Images when the page is not indexable.

## API

```ts
function getPathRobotConfig(e: H3Event, options?: GetPathRobotConfigOptions): GetPathRobotResult

interface GetPathRobotConfigOptions {
  userAgent?: string
  skipSiteIndexable?: boolean
  path?: string
}
interface GetPathRobotResult {
  rule: string
  indexable: boolean
  debug?: { source: string, line?: string }
}
```

### Arguments

- `**e: H3Event**`: The request event object, used to determine the current path.
- `**options**`: Optional options.
  - `**userAgent: string**`: The user agent to use for the check. Some pages may have different rules for different user agents.
  - `**skipSiteIndexable: boolean**`: Skip the site indexable check. Allows you to check the page indexable while ignoring the site-wide config.
  - `**path: string**`: An override for which path to check. By default, it will use the current path of the `**H3Event**`.

### Returns

- `**rule: string**`: The rule for the page.
- `**indexable: boolean**`: Whether the page is indexable.
- `**debug?: { source: string, line?: string }**`: Debug information about the source of the rule and the matching line. This is only available in development mode.

## Example

```ts
import { defineNitroPlugin, getPathRobotConfig } from '#imports'

export default defineNitroPlugin((nitroApp) => {
  // strip og meta tags if the site is not indexable
  nitroApp.hooks.hook('render:html', async (ctx, { event }) => {
    const { indexable } = getPathRobotConfig(event)
    if (!indexable) {
      ctx.head = ctx.head.map(s => s.replace(/<meta property="og:.*?">/g, ''))
    }
  })
})
```

**Was this page helpful?**

### **Related **

[**getSiteRobotConfig()**](https://nuxtseo.com/docs/robots/nitro-api/get-site-robot-config)

[**useRobotsRule()**](https://nuxtseo.com/docs/robots/api/use-robots-rule)

[**getSiteIndexable()**](https://nuxtseo.com/docs/site-config/nitro-api/get-site-indexable)

[**getSiteRobotConfig()** See if the Site is indexable within Nitro.](https://nuxtseo.com/docs/robots/nitro-api/get-site-robot-config) [**getBotDetection()** Server-side composable to access bot detection state in Nitro routes and middleware.](https://nuxtseo.com/docs/robots/nitro-api/get-bot-detection)