---
title: "updateSiteConfig() · Nuxt Site Config · Nuxt SEO"
canonical_url: "https://nuxtseo.com/docs/site-config/api/update-site-config"
last_updated: "2026-08-14T16:53:46.516Z"
meta:
  description: "Learn how to modify site config at runtime."
  "og:description": "Learn how to modify site config at runtime."
  "og:title": "updateSiteConfig() · Nuxt Site Config · Nuxt SEO"
---

Nuxt SEO on GitHub

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

**Nuxt API**

# **updateSiteConfig()**

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

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~~**](https://nuxtseo.com/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.

plugins/site-config.server.ts

```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
  }
})
```

**Was this page helpful?**

### **Related **

[**updateSiteConfig()**](https://nuxtseo.com/docs/site-config/nitro-api/update-site-config)

[**useSiteConfig()**](https://nuxtseo.com/docs/site-config/api/use-site-config)

[**Runtime Site Config**](https://nuxtseo.com/docs/site-config/guides/runtime-site-config)

[**useSiteConfig()** How to access site config within a Nuxt context.](https://nuxtseo.com/docs/site-config/api/use-site-config) [**createSitePathResolver()** Create a function to resolve a path relative to the site.](https://nuxtseo.com/docs/site-config/api/create-site-path-resolver)