seofields
v1.0.10 — Sanity v3 & v4

Complete SEO
toolkit for Sanity

Meta tags, Open Graph, X Cards, robots directives, live preview, and a built-in health dashboard — everything you need to ship SEO-ready content.

SEO Health

Your page is in excellent shape

Excellent
95score
Search Preview live

https://example.com › about

About Our Company — Example Site

Learn about our mission, team, and values. We build products that help businesses grow their online presence.

6Schema Types
95Point Scoring
27+Field Overrides
v3/v4Sanity Support

Features

Everything you need for SEO

A complete toolkit that handles meta tags, social cards, indexing controls, and content health — all inside Sanity Studio.

🎯

Meta Tags

Title, description, keywords, canonical URLs with character guidance.

📊

Health Dashboard

95-point scoring system with actionable improvement tips. Track SEO health across all documents.

📱

Open Graph

Complete OG support — title, description, image, site name, URL, and type.

🐦

X (Twitter) Cards

Summary, large image, app, and player cards with handle support.

👁️

Live SERP Preview

See exactly how your page appears in Google results — in real time as you type.

🤖

Robots Directives

Control indexing, following, and max snippets per document.

🔧

27+ Field Overrides

Customize labels, descriptions, and placeholders for every field.

👁️‍🗨️

Field Visibility

Show or hide specific fields per document type or globally.

Zero Config

Works out of the box. Add to plugins and start using immediately.

How It Works

Three steps to SEO-ready content

1

Install & register

sanity.config.ts
import { defineConfig } from 'sanity'
import seofields from 'sanity-plugin-seofields'

export default defineConfig({
  plugins: [
    seofields(),   // zero-config
  ],
  schema: {
    types: [/* your schemas */],
  },
})
2

Add to your schema

schemas/page.ts
import { defineField, defineType } from 'sanity'

export default defineType({
  name: 'page',
  title: 'Page',
  type: 'document',
  fields: [
    defineField({ name: 'title', type: 'string' }),
    defineField({ name: 'slug', type: 'slug' }),
    defineField({
      name: 'seo',
      title: 'SEO',
      type: 'seoFields',
    }),
  ],
})
3

Query & render

lib/queries.ts
const query = groq`
  *[_type == "page" && slug.current == $slug][0]{
    title,
    seo {
      title,
      description,
      canonicalUrl,
      openGraph { title, description, image },
      twitter { card, title },
      robots { index, follow }
    }
  }
`

Health Dashboard

Real-time SEO scoring

Every document gets an instant health score with field-level feedback — right inside Sanity Studio.

SEO Health
95score

Excellent

All checks passed

Meta Title"About Our Company"+15
Meta Description"Learn about our mission…"+15
OG TitleSet+10
OG ImageUploaded+15
Twitter Cardsummary_large_image+10
Canonical URLhttps://example.com/about+10
Robotsindex, follow+10
!KeywordsNot setOptional
Score range

Poor

0–29

Needs Work

30–59

Good

60–79

Excellent

80–95

Open Source · MIT License

Start optimizing your content

Free, open source, and ready to use. Install the plugin and start improving your SEO in minutes.