# Sanity structured data

> Model the source facts in Sanity, project them into page-specific JSON-LD, and validate the rendered output against Google

Canonical: https://scaplet.com/seo/sanity/structured-data

Guide Sanity Sanity · Structured data

Model the source facts in Sanity, project them into page-specific JSON-LD, and validate the rendered output against Google's rules.

4 min

read

4

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

Sanity schemas define and validate editorial fields; they do not automatically generate schema.org JSON-LD. Query the fields that describe a page, map them to a Google-supported JSON-LD type in your frontend, and render that markup with the visible page content. Validate the deployed URL and keep both outputs tied to the same source record.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsanity%2Fstructured-data%20(%22Sanity%20structured%20data%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsanity%2Fstructured-data%20(%22Sanity%20structured%20data%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsanity%2Fstructured-data%20(%22Sanity%20structured%20data%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsanity%2Fstructured-data%20(%22Sanity%20structured%20data%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 4 minutes.

1. [Keep the content model and search markup separate 01](#keep-the-content-model-and-search-markup-separate)
2. [Build a page-specific projection 02](#build-a-page-specific-projection)
3. [Prevent drift as models and pages evolve 03](#prevent-drift-as-models-and-pages-evolve)

_01_One fact can have two different jobs

## Keep the content model and search markup separate

A Sanity schema is the editorial content model: it defines document types, fields, references, and validation for Studio. [JSON-LD](/glossary/json-ld) is a representation delivered in the website's HTML for crawlers. Sanity's [glossary](/glossary/glossary-page) says: "Sanity does not ship a [schema.org](/glossary/schema-markup) or JSON-LD generator as a product feature." What it provides is typed source fields and a query language that can project them into the shape your frontend serializes into the page, so your frontend owns the mapping and serialization.

Sanity field

### `title`

Page use

Visible article or product heading

Possible JSON-LD property

`headline` or `name`, depending on the actual type

Sanity field

### `publishedAt`

Page use

Visible publication date

Possible JSON-LD property

`datePublished` when the page qualifies as an Article

Sanity field

### `mainImage`

Page use

Image shown on the page

Possible JSON-LD property

`image` when the target type supports it

Sanity field

### `author` reference

Page use

Visible byline and linked [author profile](/glossary/author-bio)

Possible JSON-LD property

`author` as a Person or Organization [entity](/glossary/entity)

Sanity field

### `offers` or product fields

Page use

Displayed price and availability

Possible JSON-LD property

Product and Offer properties only when the page and policy requirements fit

**A Sanity schema is not a Google schema**The word schema refers to two separate layers here. Sanity controls what editors can enter. Schema.org describes page facts for consumers such as Google. Map between them intentionally; a field name alone does not create valid JSON-LD.

_02_How it works

## Build a page-specific projection

1. 1

### Pick a supported use case

Start with a page that fits a Google search feature, such as an article or product detail. Read that feature's required properties and eligibility rules before changing the content model.
2. 2

### Model facts editors can maintain

Use Sanity fields and references for the real page facts: title, author, image, dates, product identifiers, price, and availability as applicable. Add validation for required values and constrain references so editors can select legitimate records.
3. 3

### Project only what this route needs

Use a GROQ projection in the page data query to select and rename the document fields that feed the target JSON-LD object. Keep projection logic near the frontend's [rendering](/glossary/rendering) boundary or in a shared, typed mapper.
4. 4

### Render JSON-LD with the same record

Serialize a page-specific object into an `application/ld+json` script. Reuse the fetched record used for the visible page so title, dates, price, and availability do not drift between markup and content.
5. 5

### Validate the production response

Inspect the deployed HTML, run Google's Rich Results Test for eligible types, then use URL Inspection and Search Console reports after rollout. Test a missing optional field and a changed record as well as the happy path.

For a Product page, a mapper could turn the actual Sanity product title, canonical product URL, image asset URL, and current offer record into `Product` and `Offer` properties. Do not invent aggregate ratings, shipping promises, brand details, or availability to satisfy a schema checklist. If the visible page does not show a fact or the source record cannot substantiate it, leave it out.

_03_Checklist

## Prevent drift as models and pages evolve

First_2_
Keep field names and JSON-LD properties distinct in code. A Sanity field named `author` may be a reference that must be resolved into a Person or Organization object.

Handle references that are missing or unpublished. Omit optional properties rather than emitting `null`, empty strings, broken URLs, or stale references.

Next_2_
For localized documents, map each language URL to its own visible title and canonical URL. Keep hreflang relationships consistent across the published variants.

Use the right image URL and dimensions for the page type. Sanity image assets can be transformed; test that the final URL is public and returns an image, not a Studio-only reference.

Then_1_
Changing a Sanity schema does not by itself change your frontend markup. Test a built or deployed route after changes to a model or mapper.

Structured data can make a page eligible for some enhanced results, but Google says it "does not guarantee that your structured data will show up in search results, even if your page is marked up correctly according to the Rich Results Test." Google also tells you not to mark up content that is not visible to readers of the page. Measure technical validity and search outcomes separately.

For Google eligibility and validation, see [structured data basics](/glossary/structured-data) and [missing structured data](/seo-issues/missing-structured-data).

Sources · 4

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- sanity.io
- google.com

1. 01 [Introduction to schemas | Sanity Docs](https://www.sanity.io/docs/apis-and-sdks/introduction-to-schemas) sanity.io · checked 2026-10-24
2. 02 [Structured data | Sanity Glossary](https://www.sanity.io/glossary/structured-data) sanity.io · checked 2026-10-24
3. 03 [General structured data guidelines | Google Search Central](https://developers.google.com/search/docs/appearance/structured-data/sd-policies) developers.google.com · checked 2026-10-24
4. 04 [Intro to structured data markup in Google Search](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data) developers.google.com · checked 2026-10-24

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ Does Sanity generate JSON-LD automatically?

No. Sanity supplies a content model and queryable documents; your frontend maps those fields to schema.org JSON-LD and renders the script in the page.

_02_ Should Sanity schema types match schema.org types?

Not necessarily. Sanity models editorial workflows and reusable content. Map its fields and references to the schema.org type that accurately describes each public page.

_03_ Can valid JSON-LD guarantee a Google rich result?

No. Valid markup can make an eligible page technically qualified, but Google decides whether to show an enhancement.

## Keep learning

[All platform guides](/seo)

[Learn Sanity SEO Headless CMS](/seo/sanity) [Related Article schema Content](/schema/article) [Read next WordPress structured data CMS](/seo/wordpress/structured-data) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Shopify SEO](/seo/shopify)

More in Sanity SEO
[Sanity image SEO](/seo/sanity/image-seo) [Sanity redirects](/seo/sanity/redirects) [Sanity structured data](/seo/sanity/structured-data) [Sanity XML sitemap](/seo/sanity/xml-sitemap)

Terms on this page
[JSON-LD](/glossary/json-ld) [Glossary page](/glossary/glossary-page) [Schema Markup](/glossary/schema-markup) [Author bio](/glossary/author-bio) [Entity](/glossary/entity) [Rendering](/glossary/rendering) [Structured data](/glossary/structured-data)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
