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:
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:
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:
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:
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:
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:
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.
WebsiteRepresents an entire website — name, URL, publisher, language.
OrganizationA company or organization — logo, social links, contact point.
WebPageAn individual web page — name, URL, description, parent site.
PersonA person — name, job title, social profiles, employer.
ArticleA news, scholarly, or blog article with author and publisher.
BlogPostingA blog post — headline, author, date, main entity page.
FAQPageFrequently Asked Questions — eligible for rich results.
HowToStep-by-step instructions — eligible for rich results.
BreadcrumbListNavigation breadcrumbs — improves search appearance.
ProductA product — name, brand, image, description.
OfferA product offer — price, currency, availability.
AggregateRatingAverage rating based on multiple reviews.
ReviewAn individual review — author, rating, body.
BrandA brand entity — name identification.
LocalBusinessA local business — address, phone, opening hours.
PostalAddressA structured postal/mailing address.
ContactPointContact info — type, email, phone, languages.
SoftwareApplicationA software app — category, OS, offers.
WebApplicationA web-based application — URL, category.
EventAn event — date, location, organizer.
PlaceA place or venue — name, address, geo.
VideoObjectA video — thumbnail, upload date, content URL.
ImageObjectAn image — URL, dimensions, caption.
CourseAn educational course — name, provider, description.
Import Paths
sanity-plugin-seofields/schemaSanity Studio plugins, schema factories, data types, and generator utilities.
sanity-plugin-seofields/schema/nextReact components that render <script type="application/ld+json"> tags.
sanity-plugin-seofields/nextAll Schema.org components + SEO meta helpers (buildSeoMeta, SeoMetaTags).
Was this page helpful?