seofields
docs

Introduction

sanity-plugin-seofields is a comprehensive Sanity Studio v3/v4 plugin that manages SEO fields including meta titles, descriptions, Open Graph tags, X (formerly Twitter) Cards, and robots settings — with live preview and health scoring.

Key Philosophy

One plugin, zero configuration required. Add it to your Sanity config and every document gets structured SEO fields, live SERP previews, and a studio-wide health dashboard — all out of the box.

Features

Meta Tags — title, description, keywords, canonical URLs
Open Graph — complete social media sharing optimization
X (Twitter) Cards — card types, handles, images
Robots Control — noIndex/noFollow directives
Image Management — upload or URL-based social images
Live SEO Preview — real-time SERP preview as you edit
Health Dashboard — studio-wide 0–100 scoring
Field Visibility — hide fields per document type
Custom Meta Tags — flexible key/value attributes
TypeScript — full type definitions included
Field Overrides — customize every label and description
Sanity v3 & v4 — supports both major versions

Schema Types

seoFields

Complete SEO package — meta tags, OG, Twitter, robots, keywords, images.

openGraph

Standalone Open Graph configuration for social media sharing.

twitter

X (formerly Twitter) Card settings with card type, handles, and images.

metaTag

Array container for custom meta attributes (key/value pairs).

metaAttribute

Individual meta attribute — supports both text and image values.

robots

Search engine directives — noIndex and noFollow toggles.

Quick Example

sanity.config.ts
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 */],
  },
})