---
title: "updateSiteConfig()"
description: "Learn how to modify site config at runtime."
canonical_url: "https://nuxtseo.com/docs/site-config/api/update-site-config"
last_updated: "2026-05-25T04:24:09.510Z"
---

Modify the site config at runtime. You can provide any config to this function, such as the [recommended config](/docs/site-config/guides/how-it-works).

<u-badge color="amber" label="Warning">



</u-badge>

When using this, you will need to run it as early as possible in the Nuxt lifecycle to avoid conflicts with other modules.
It's recommended to use the Nitro [updateSiteConfig](/docs/site-config/nitro-api/update-site-config) API instead.

## Usage

Returns a dispose function that removes the config entry from the stack when called.

```ts [plugins/site-config.server.ts]
import { updateSiteConfig } from '#imports'

export default defineNuxtPlugin({
  enforce: 'pre', // make it happen early
  setup() {
    const dispose = updateSiteConfig({
      name: 'My Site',
      url: 'https://example.com',
    })
    // call dispose() to remove this config entry
  }
})
```
