---
title: "Nuxt Hooks"
description: "Learn how to use Nuxt hooks to modify the robots config."
canonical_url: "https://nuxtseo.com/docs/robots/api/nuxt-hooks"
last_updated: "2026-07-26T11:14:57.993Z"
---

## `'robots:config'`

**Type:** `(config: ResolvedModuleOptions) => void | Promise<void>`

This hook allows you to modify the robots config before it is used to generate the robots.txt and meta tags.

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  hooks: {
    'robots:config': (config) => {
      // modify the config
      config.sitemap = '/sitemap.xml'
    },
  },
})
```
