Best Practice Default Meta

The default meta tags Nuxt SEO sets for you.

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 url, the current route and the canonicalQueryWhitelist.

canonicalQueryWhitelist

By default, the canonicalQueryWhitelist includes a number of common query parameters that will modify the page content:

  • 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.

nuxt.config.ts
export default defineNuxtConfig({
  seo: {
    canonicalQueryWhitelist: ['myCustomQuery']
  }
})

I18n

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.

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 config currentLocale and defaultLocale.
  • og:site_name - The name of your site based on site config name.

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.

nuxt.config.ts
export default defineNuxtConfig({
  seo: {
    automaticDefaults: false
  }
})
Did this page help you?