npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sanity-plugin-seofields

v1.6.5

Published

The only Sanity Studio SEO plugin with a built-in audit dashboard. Manage meta tags, Open Graph, Twitter Cards, robots directives, JSON-LD structured data, and 38 Schema.org types.

Readme

sanity-plugin-seofields

npm version npm downloads license GitHub stars

The only Sanity SEO plugin with a built-in audit dashboard.

Manage meta tags, Open Graph, Twitter Cards, robots directives, and 38 Schema.org/JSON-LD types — all inside Sanity Studio v3/v4/v5.

📖 Full Documentation →


⭐ If this plugin saves you time, please leave a rating on the Sanity Plugin Directory, star it on GitHub, and leave a review on the docs site. It helps other developers find it.


Installation

npm install sanity-plugin-seofields

Quick Start

1. Register the plugin

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

export default defineConfig({
  plugins: [seofields()],
})

2. Add SEO fields to a document

import {defineField, defineType} from 'sanity'

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

That's it. The seoFields type is automatically registered by the plugin.


Available Schema Types

| Type | Description | | --------------- | ------------------------------------ | | seoFields | Complete SEO bundle (recommended) | | openGraph | Open Graph tags for social sharing | | twitter | X (Twitter) Card settings | | metaTag | Container for custom meta attributes | | metaAttribute | Single key/value meta attribute | | robots | noindex / nofollow directives |


Configuration

seofields({
  seoPreview: true,
  fieldOverrides: {
    title: {title: 'Page Title'},
  },
  defaultHiddenFields: ['openGraphSiteName', 'twitterSite'],
  fieldVisibility: {
    post: {hiddenFields: ['twitterSite']},
  },
})

| Option | Type | Default | Description | | --------------------- | --------- | ------- | --------------------------------------- | | seoPreview | boolean | true | Enable/disable live SEO preview | | fieldOverrides | object | {} | Customize field titles and descriptions | | defaultHiddenFields | array | [] | Hide sitewide fields globally | | fieldVisibility | object | {} | Hide fields per document type |

Full configuration reference


SEO Health Dashboard

This is the feature that sets this plugin apart from every other Sanity SEO plugin.

A built-in Studio tool that audits SEO completeness across all your documents at once — scores each document, highlights missing fields, and links directly to what needs fixing. No external tools. No leaving Studio.

Requires a free license key — get yours here.

seofields({
  dashboard: {
    enabled: true,
    licenseKey: process.env.SANITY_STUDIO_SEO_LICENSE_KEY,
  },
})

Dashboard docs


Schema.org / JSON-LD

The plugin ships 38 Schema.org types as Sanity schema definitions + React components that render <script type="application/ld+json"> tags.

1. Register schema types in Studio

// sanity.config.ts
import {schemaOrg} from 'sanity-plugin-seofields/schema'

export default defineConfig({
  plugins: [seofields(), schemaOrg()], // all 38 types at once
})

Or register only what you need:

import {schemaOrgArticlePlugin, schemaOrgOrganizationPlugin} from 'sanity-plugin-seofields/schema'

export default defineConfig({
  plugins: [seofields(), schemaOrgArticlePlugin(), schemaOrgOrganizationPlugin()],
})

2. Add to a document schema

defineField({name: 'schemaOrg', type: 'schemaOrg'}) // combined array field
// or individual types:
defineField({name: 'article', type: 'schemaOrgArticle'})

3. Render in Next.js

// Combined renderer
import {SchemaOrgScripts} from 'sanity-plugin-seofields/schema/next'

export default function Layout({data}) {
  return <SchemaOrgScripts items={data.schemaOrg} />
}

// Or individual components
import {ArticleSchema, OrganizationSchema} from 'sanity-plugin-seofields/schema/next'

export default function Page({data}) {
  return (
    <>
      <ArticleSchema data={data.article} />
      <OrganizationSchema data={data.org} />
    </>
  )
}

All 38 available types: AggregateRating, Article, BlogPosting, Book, Brand, BreadcrumbList, ContactPoint, Country, Course, Event, FAQPage, HowTo, ImageObject, ItemList, JobPosting, LegalService, LocalBusiness, Movie, MusicAlbum, MusicRecording, NewsArticle, Offer, Organization, Person, Place, PostalAddress, Product, ProfilePage, Recipe, Restaurant, Review, Service, SocialMediaPosting, SoftwareApplication, VideoObject, WebApplication, WebPage, Website.

Schema.org docs


Next.js Integration

import {buildSeoMeta, SeoMetaTags} from 'sanity-plugin-seofields/next'

Next.js integration guide


CLI

npx seofields

CLI docs


Links

Contributing

PRs and issues are welcome. See CONTRIBUTING.md.

License

MIT