Sanity SEO Plugin Documentation
sanity-plugin-seofields is a comprehensive Sanity Studio v3/v4/v5 plugin that manages SEO fields including meta titles, descriptions, Open Graph tags, X (formerly Twitter) Cards, and robots settings — with live preview, Schema.org JSON-LD helpers, and health scoring.
Set up the plugin
Install the Sanity SEO plugin, register it in sanity.config.ts, and add seoFields to documents.
Model PostalAddress
Map addressLocality, postalCode, addressCountry, and nested LocalBusiness or Organization address data.
Key Philosophy
One plugin, zero configuration required. Add it to your Sanity config and every document can get structured SEO fields, live SERP previews, and a studio-wide health dashboard. Use Schema.org fields when you need machine-readable context for rich results and AI answer surfaces.
Features
Feature overviews
Sanity Meta Tags
Marketing overview for editable titles, descriptions, canonical URLs, and keywords.
Open Graph & X Cards
How social preview metadata and platform-specific images work in Sanity.
Schema.org JSON-LD
Overview of 39 structured-data types, components, and JSON-LD builders.
SEO Health Dashboard
Studio-wide scoring, filters, issue lists, exports, and license notes.
Schema Types
seoFieldsComplete SEO package — meta tags, OG, Twitter, robots, editorial keywords, images.
baseMetaStandalone core meta fields — title, description, image, editorial keywords, canonical URL, and custom meta attributes.
openGraphStandalone Open Graph configuration for social media sharing.
twitterX (formerly Twitter) Card settings with card type, handles, and images.
metaTagArray container for custom meta attributes (key/value pairs).
metaAttributeIndividual meta attribute — supports both text and image values.
robotsSearch engine directives — noIndex, noFollow, noTranslate, and noImageIndex toggles.
Quick Example
import { defineConfig } from 'sanity'
import seofields from 'sanity-plugin-seofields'
export default defineConfig({
name: 'my-project',
title: 'My Project',
projectId: 'your-project-id',
dataset: 'production',
plugins: [
seofields(), // That's it — SEO fields + dashboard ready
],
schema: {
types: [/* your schemas */],
},
})Was this page helpful?