To ensure your site is SEO friendly, Nuxt SEO sets some default meta tags for you based on your site config.
Ensuring a canonical URL is set helps avoid duplicate content issues.
This can be an issue when you have multiple domains or subdomains pointing to the same content, trailing slashes and non-trailing slashes showing the same content and when you have query parameters that don't change the content.
Learn more about canonical URLs with the Canonical Link Tag guide.
The canonical URL is generated from your site config url, the current route and the canonicalQueryWhitelist.
By default, the canonicalQueryWhitelist includes a number of common query parameters that will modify the page content:
pagesortfiltersearchqqueryYou can override this by providing your own list of query parameters that should be included in the canonical URL.
export default defineNuxtConfig({
seo: {
canonicalQueryWhitelist: ['myCustomQuery']
}
})
Google wants you to list the language that any given page is written in as <html lang="<locale>">.
Nuxt SEO will set this for you based on your site config currentLocale and defaultLocale (default en).
If you're using the @nuxtjs/i18n module, then this is automatically set for you.
lang attribute.Providing extra open-graph meta tags helps social media platforms understand your content better.
The following tags are set:
og:url - The canonical URL of the page.og:locale - The current locale of the page based on site config currentLocale and defaultLocale.og:site_name - The name of your site based on site config name.While all default meta is registered with low priority, allowing you to easily override them, you may want to disable them entirely.
export default defineNuxtConfig({
seo: {
automaticDefaults: false
}
})