Core Concepts

Quick Setup Guide

Last updated by Harlan Wilton in chore: drop monorepo docs.

Introduction

Nuxt SEO is a collection of 6 modules. Most work out-of-the-box, but some configuration may be needed depending on your site.

Check out the StackBlitz Demo for a working example.

Sitemap

Sitemap v7.4.9
9.1M
407
Powerfully flexible XML Sitemaps that integrate seamlessly.

Generates a sitemap at /sitemap.xml so search engines can discover your pages.

npx nuxi module add @nuxtjs/sitemap

Default behavior:

  • Auto-generates sitemap from your app routes
  • Includes lastmod when available
  • Links to sitemap in robots.txt

Examples

export default defineNuxtConfig({
  sitemap: {
    // fetch URLs from an API endpoint
    sources: ['/api/__sitemap__/urls']
  }
})

See the Sitemap documentation for all options.

Robots

Robots v5.6.7
7.6M
499
Tame the robots crawling and indexing your site with ease.

Controls search engine crawling via robots.txt, meta tags, and HTTP headers.

npx nuxi module add @nuxtjs/robots

Default behavior:

  • Generates /robots.txt allowing all routes
  • Blocks indexing in non-production environments
  • Adds <meta name="robots"> and X-Robots-Tag header

Examples

# public/_robots.txt (recommended)
User-agent: *
Allow: /
Disallow: /admin

User-agent: GPTBot
Disallow: /

See the Robots documentation for all options.

OG Image

OG Image v5.1.13
2.8M
493
Generate OG Images with Vue templates in Nuxt.

Generates dynamic Open Graph images for social sharing.

npx nuxi module add nuxt-og-image

Default behavior:

  • Opt-in, does nothing until configured
  • Preview in Nuxt DevTools OG Image tab
  • Supports Satori (edge) or browser rendering

Examples

export default defineNuxtConfig({
  ogImage: {
    defaults: {
      component: 'OgImageTemplate',
      // pass props to your template
      title: 'My Site'
    }
  }
})

See the OG Image documentation for all options.

Schema.org

Schema.org v5.0.10
3.2M
178
The quickest and easiest way to build Schema.org graphs.

Adds structured data (JSON-LD) for rich search results.

npx nuxi module add nuxt-schema-org

Default behavior:

  • Adds WebSite and WebPage schema automatically
  • Integrates with Site Config for organization data
  • Skips schema on non-indexable pages

Examples

export default defineNuxtConfig({
  schemaOrg: {
    identity: {
      type: 'Organization',
      name: 'My Company',
      logo: '/logo.png',
      sameAs: ['https://twitter.com/mycompany']
    }
  }
})

See the Schema.org documentation for all options.

Link Checker v4.3.9
2.3M
95
Find and magically fix links that may be negatively effecting your SEO.

Finds broken links before they hurt your SEO.

npx nuxi module add nuxt-link-checker

Default behavior:

  • Checks links during build
  • Reports in DevTools Link Checker tab
  • Warns but doesn't fail build

Examples

export default defineNuxtConfig({
  linkChecker: {
    failOnError: true,
    // generate reports
    report: {
      html: true,
      markdown: true
    }
  }
})

See the Link Checker documentation for all options.

SEO Utils

SEO Utils v7.0.19
1.4M
119
SEO utilities to improve your Nuxt sites discoverability and shareability.

Extra SEO utilities: breadcrumbs, default meta, file metadata.

npx nuxi module add nuxt-seo-utils

Default behavior:

  • Auto-detects favicon.ico, apple-touch-icon.png in public folder
  • Falls back to site.name for missing page titles
  • Provides useBreadcrumbs() composable

Examples

export default defineNuxtConfig({
  routeRules: {
    '/blog/**': {
      seoMeta: {
        ogType: 'article'
      }
    },
    '/products/**': {
      seoMeta: {
        ogType: 'product'
      }
    }
  }
})

See the SEO Utils documentation for all options.

Shared Configuration

Site Config v3.2.14
8.7M
75
Powerful build and runtime shared site configuration for Nuxt modules.

Central config shared across all SEO modules. Set once, used everywhere.

Default behavior:

  • Auto-installed with any SEO module
  • Detects production vs development environment
  • Reads from NUXT_SITE_URL env var

Examples

export default defineNuxtConfig({
  site: {
    url: 'https://example.com',
    name: 'My Site',
    description: 'Welcome to my site',
    defaultLocale: 'en'
  }
})

See the Site Config documentation for all options.

Did this page help you?