Sanity plugin for Google structured data schema integration?
Great question! This is something many developers think about when working with structured content, and you're absolutely right that it feels like a natural fit for Sanity's content modeling approach.
The good news: There is actually a Schema Markup plugin that helps with generating structured data for various content types. This plugin simplifies the process of creating schema.org markup for your Sanity documents.
Why there isn't more out-of-the-box: While Sanity doesn't ship with pre-built schema.org schemas as core document types, this is likely intentional. Here's why:
Flexibility over prescription - Schema.org types like Event, Article, Person, etc. are often just a starting point. Most real-world content needs additional fields, different validation rules, or custom structures that go beyond the basic schema.org spec. If Sanity provided rigid schema.org types, you'd likely end up fighting against them or extending them anyway.
Structured data is output, not storage - As mentioned in Sanity's SEO optimization course, JSON-LD structured data is typically generated at render time from your content. You might have a rich "Event" document in Sanity with lots of internal fields, but only map a subset to the schema.org Event format for JSON-LD output.
Localization complexity - You mentioned localization, and this is a perfect example. How schema.org types should be localized varies by implementation. Some fields should be translated, others shouldn't. This is very project-specific.
Practical approach: Many developers create their own schema.org-aligned document types as reusable schemas within their projects, or use the Schema Markup plugin mentioned above. The community has discussed this and some have even suggested publishing reusable schema.org-based schemas as community plugins.
Sanity's take: Their philosophy seems to be that structured data generation is part of the "content enrichment" layer - you model your content for editorial needs first, then transform it into schema.org formats at the presentation layer. Since "structured data is what Sanity does best," the transformation is usually straightforward in your frontend code.
That said, if you're building Event schemas repeatedly, definitely consider packaging your solution as a plugin for others! The community would likely appreciate it, and it sounds like you're already doing the work anyway.
Show original thread4 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.