Best Practice Default Meta
Introduction
To ensure your site is SEO friendly, Nuxt SEO sets some default meta tags for you based on your site config.
Canonical URL
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
canonicalQueryWhitelist
By default, the
page sort filter search q query
You 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']
}
})
I18n
Google wants you to list the language that any given page is written in as
Nuxt SEO will set this for you based on your site config
If you're using the
Open Graph
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 configcurrentLocale anddefaultLocale .og:site_name - The name of your site based on site configname .
Disable Default Meta
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
}
})