Default Schema.org

The default Schema.org setup for Nuxt Schema.org.

Introduction

Nuxt Schema.org uses Schema.org graphs to provide structured data to search engines. These graphs have root nodes that describe the site and the page.

{
  "@context": "https://schema.org",
  "@graph": []
}

The module automatically sets up two default nodes for you: WebSite and WebPage.

{
  "@id": "https://nuxtseo.com/#website",
  "@type": "WebSite",
  "description": "Nuxt SEO is a collection of hand-crafted Nuxt Modules to help you rank higher in search engines.",
  "name": "Nuxt SEO",
  "url": "https://nuxtseo.com"
}
{
  "@id": "https://nuxtseo.com/#webpage",
  "@type": "WebPage",
  "description": "content",
  "url": "https://nuxtseo.com",
  "isPartOf": {
    "@id": "https://nuxtseo.com/#website"
  },
  "potentialAction": [
    {
      "@type": "ReadAction",
      "target": [
        "https://nuxtseo.com"
      ]
    }
  ]
}

In this example we have configured our site using Site Config:

export default defineNuxtConfig({
  siteConfig: {
    title: 'Nuxt SEO',
    description: 'Nuxt SEO is a collection of hand-crafted Nuxt Modules to help you rank higher in search engines.',
    url: 'https://nuxtseo.com'
  }
})
Site Config v2.2.21
1.1M
65
Powerful build and runtime shared site configuration for Nuxt modules.

Configuring Your Defaults

If you'd like to change any of the data on the WebPage or WebSite nodes, you can do so by using useSchemaOrg in your app.

This will merge in your configuration with the default configuration.

app.vue
<script lang="ts" setup>
useSchemaOrg([
  defineWebPage({
    name: 'My Page'
  }),
  defineWebSite({
    name: 'My Site'
  })
])
</script>

Opt-out

If you don't want to use the default setup, you can opt-out by setting defaults: false in your nuxt.config:

nuxt.config.ts
export default defineNuxtConfig({
  schemaOrg: {
    defaults: false
  }
})

Configuring Identity

Please see the Setup Identity guide for more information on configuring your identity.

Did this page help you?