Guide
How to Set Up a Sanity SEO Plugin
To set up a Sanity SEO plugin, install sanity-plugin-seofields, add it to sanity.config.ts, and place a seoFields field on the document types that need metadata, Open Graph tags, JSON-LD, previews, and scoring.
Install the package
Install from npm with your package manager of choice:
npm install sanity-plugin-seofieldsRegister the plugin
Add the plugin to your Sanity config. Add schemaOrg() when you want the full structured-data field set.
import { defineConfig } from 'sanity'
import seofields from 'sanity-plugin-seofields'
import { schemaOrg } from 'sanity-plugin-seofields/schema'
export default defineConfig({
name: 'my-studio',
title: 'My Studio',
projectId: 'your-project-id',
dataset: 'production',
plugins: [
seofields(),
schemaOrg(),
],
schema: {
types: [/* your document schemas */],
},
})Add SEO fields
Add seoFields to any document type where editors should control search and social metadata.
import { defineField, defineType } from 'sanity'
export default defineType({
name: 'page',
title: 'Page',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
}),
defineField({
name: 'slug',
title: 'Slug',
type: 'slug',
options: { source: 'title' },
}),
defineField({
name: 'seo',
title: 'SEO',
type: 'seoFields',
}),
],
})Feature coverage
| Feature | Included | Notes |
|---|---|---|
| SEO fields | Yes | Meta title, description, image, canonical URL, keywords, robots, Open Graph, and X Cards. |
| Schema.org JSON-LD | Yes | 39 structured-data types with Studio schemas and Next.js rendering helpers. |
| SERP preview | Yes | Live Google-style preview while editors work in Sanity Studio. |
| Health scoring | Paid dashboard | The SEO Health Dashboard is a one-time $20 license per Sanity project. |
Free vs paid
The core Sanity SEO plugin features are free: SEO fields, Open Graph, X Cards, robots controls, canonical URLs, live previews, and Schema.org helpers. The paid part is the SEO Health Dashboard, which adds studio-wide scoring, filters, exports, and a dashboard view for a one-time $20 license per project.
Next steps
FAQ
Does sanity-plugin-seofields work with Sanity v5?
Yes. The plugin supports Sanity Studio v3, v4, and v5.
Do I need the paid dashboard to use SEO fields?
No. The SEO fields and Schema.org helpers are available without a dashboard license.
Can I organize SEO fields into tabs?
Yes. Use field groups to separate Meta, Open Graph, and Twitter Card fields.