v2 RC to v2 Stable
Introduction
This guide will help you migrate from the Nuxt SEO v2 RC to the v2 stable release.
Please see the announcement post for details on the release.
Support
If you get stuck with the migration or have post-migration bugs, please get in touch!
Nuxt Site Config v3
Nuxt Site Config is a module used internally by Nuxt Robots.
The major update to v3.0.0 shouldn't have any direct effect on your site, however, you may want to double-check the breaking changes.
Nuxt SEO Utils v6
In moving to the stable release, Nuxt SEO experiments has been renamed from
The original name of the module was
With this rename the module scope changes to include the random functionality that Nuxt SEO was previously providing:
useBreadcrumbItems() composable- Config:
redirectToCanonicalSiteUrl - Config:
fallbackTitle - Config:
automaticDefaults
As Nuxt SEO Utils shared the same config key as the Nuxt SEO module, no changes are required to your config, however, it's worth testing your site to ensure that everything is working as expected.
Nuxt Sitemap v7
inferStaticPagesAsRoutes config Removed
If you set this value to
export default defineNuxtConfig({
sitemap: {
- inferStaticPagesAsRoutes: false,
+ excludeAppSources: ['pages', 'route-rules', 'prerender']
}
})
dynamicUrlsApiEndpoint config Removed
The
export default defineNuxtConfig({
sitemap: {
- dynamicUrlsApiEndpoint: '/__sitemap/urls',
+ sources: ['/__sitemap/urls']
}
})
cacheTtl config Removed
Please use the
export default defineNuxtConfig({
sitemap: {
- cacheTtl: 10000,
+ cacheMaxAgeSeconds: 10000
}
})
index route rule / Nuxt Content support Removed
If you were using the
export default defineNuxtConfig({
routeRules: {
// use the `index` shortcut for simple rules
- '/secret/**': { index: false },
+ '/secret/**': { robots: false },
}
})
Nuxt Robots v5
rules config Removed
The v4 of Nuxt Robots provided a backward compatibility
export default defineNuxtConfig({
robots: {
- rules: {},
+ groups: {}
}
})
defineRobotMeta composable Removed
This composable didn't do anything in v4 as the robots meta tag is enabled by default. If you'd like to control the robot meta tag rule, use the
- defineRobotMeta(true)
+ useRobotsRule(true)
RobotMeta component Removed
This component was a simple wrapper for
index , indexable config Removed
When configuring robots using route rules or Nuxt Content you could control the robot's behavior by providing
These are no longer supported and you should use
export default defineNuxtConfig({
routeRules: {
// use the `index` shortcut for simple rules
- '/secret/**': { index: false },
+ '/secret/**': { robots: false },
}
})
Features
blockAiBots Config
AI crawlers can be beneficial as they can help users finding your site, but for some educational sites or those not
interested in being indexed by AI crawlers, you can block them using the
export default defineNuxtConfig({
robots: {
blockAiBots: true
}
})
This will block the following AI crawlers: