Installation
Install the plugin with your preferred package manager.
npm
Package Managers
Requirements
Register the Plugin
Add the plugin to your sanity.config.ts (or .js) file:
import { defineConfig } from 'sanity'
import seofields from 'sanity-plugin-seofields'
export default defineConfig({
name: 'your-project',
title: 'Your Project',
projectId: 'your-project-id',
dataset: 'production',
plugins: [
seofields(), // Add the SEO fields plugin
// ... other plugins
],
schema: {
types: [
// ... your schema types
],
},
})Note: The plugin works with zero configuration. The live SERP preview is on by default; the SEO Health Dashboard needs a license key.
Verify the installation
- Add a field of type
seoFieldsto a document type, for exampledefineField({ name: 'seo', type: 'seoFields' }). - Start Studio with
npx sanity dev, open a document of that type and expand the SEO field. You should see title, description, Open Graph and X fields, the SERP preview and character counters. - Run
npx seofields doctor. It checks locally that your Studio config exists, the plugin is registered and thesanityandreactpeer dependencies are installed.
Troubleshooting
- ERESOLVE peer dependency error on Studio 6: upgrade to
sanity-plugin-seofields@1.11.0or later, which widened the supported Studio range to include v6. - Missing icon export errors: use version 1.11.0 or later. It works with the
@sanity/iconsversions that Studio 3 to 6 ship. - Nothing appears in the document: confirm the field type is
seoFields(case-sensitive) and thatseofields()is in thepluginsarray.
Installation FAQ
Which Sanity Studio versions does sanity-plugin-seofields support?
Sanity Studio v3, v4, v5 and v6, with React 18 or 19.
Do I need a license key to install it?
No. The core plugin is free and MIT licensed. A one-time $20 license per Sanity project unlocks the SEO Health Dashboard, Publish Gate and other paid features.
Does it work with pnpm and yarn?
Yes. Install it with npm, yarn or pnpm; the commands are on this page.
Optional: License Key for Paid Features
The core plugin works without a key. To use paid features, add a valid root-level license key. $20 per Sanity project unlocks paid plugin features as a one-time purchase. Roadmap improvements are tracked on the roadmap. One-time payment, no subscription.
Get your license key at the Get License page →
See Dashboard docs for setup instructions and configuration options.
Was this page helpful?