Skip to main content
seofields
docs

Schema.org Structured Data

Add Schema.org JSON-LD structured data to your Sanity-powered site. 24 built-in types with Sanity Studio fields and typed Next.js components.

Why Schema.org matters in the AI era

The plugin is not only limited to SEO fields anymore. AI search engines like Google AI Overviews, Perplexity, and ChatGPT Search rely on structured data to understand, cite, and surface your content. Schema.org markup is the foundation of AEO (Answer Engine Optimization) and GEO (Generative Engine Optimization).

Quick Start

Register all 24 types at once with the combined plugin:

sanity.config.ts
import { defineConfig } from 'sanity'
import seofields from 'sanity-plugin-seofields'
import { schemaOrg } from 'sanity-plugin-seofields/schema'

export default defineConfig({
  // ...
  plugins: [
    seofields(),    // SEO fields + dashboard
    schemaOrg(),    // all 24 Schema.org types
  ],
})

Individual Plugins

Or register only the types you need:

sanity.config.ts — individual
import { defineConfig } from 'sanity'
import {
  schemaOrgWebsitePlugin,
  schemaOrgOrganizationPlugin,
  schemaOrgArticlePlugin,
  schemaOrgFAQPagePlugin,
} from 'sanity-plugin-seofields/schema'

export default defineConfig({
  // ...
  plugins: [
    schemaOrgWebsitePlugin(),
    schemaOrgOrganizationPlugin(),
    schemaOrgArticlePlugin(),
    schemaOrgFAQPagePlugin(),
  ],
})

Schema Usage

When using schemaOrg(), a combined schemaOrg array field is registered that can hold multiple Schema.org types. Add it to any document schema:

schemas/page.ts
import { defineField, defineType } from 'sanity'

export default defineType({
  name: 'page',
  title: 'Page',
  type: 'document',
  fields: [
    // ... your other fields
    defineField({
      name: 'schemaOrg',
      title: 'Schema.org Structured Data',
      type: 'schemaOrg',
    }),
  ],
})

Or use individual types directly:

Individual fields
defineField({
  name: 'schemaOrgWebsite',
  title: 'Website Schema',
  type: 'schemaOrgWebsite',
}),
defineField({
  name: 'schemaOrgOrganization',
  title: 'Organization Schema',
  type: 'schemaOrgOrganization',
}),

Rendering in Next.js

Each type has a React component that renders a valid <script type="application/ld+json"> tag:

app/layout.tsx
import {
  WebsiteSchema,
  OrganizationSchema,
  ArticleSchema,
} from 'sanity-plugin-seofields/schema/next'

export default function Layout({ data }) {
  return (
    <>
      <WebsiteSchema data={data.website} />
      <OrganizationSchema data={data.organization} />
      <ArticleSchema data={data.article} />
      {/* ... */}
    </>
  )
}

Combined Schema Array

When using schemaOrg(), a schemaOrg array field is registered that can hold multiple types. Render all of them with one component:

Combined renderer
import { SchemaOrgScripts } from 'sanity-plugin-seofields/schema/next'

// In your page component
<SchemaOrgScripts items={data.schemaOrg} />

All Schema.org Types

Click any type to see its fields, JSON-LD output, and usage examples.

Import Paths

sanity-plugin-seofields/schema

Sanity Studio plugins, schema factories, data types, and generator utilities.

sanity-plugin-seofields/schema/next

React components that render <script type="application/ld+json"> tags.

sanity-plugin-seofields/next

All Schema.org components + SEO meta helpers (buildSeoMeta, SeoMetaTags).

Was this page helpful?