docs
Product
Add Product structured data to your Sanity-powered site. Enable rich results with pricing, availability, and ratings in Google Shopping and search.
About Product
Product schema enables rich results with pricing, availability, and ratings in Google Shopping and search. Marking up your products with structured data helps them stand out in search results and can improve click-through rates for e-commerce pages.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The name of the product. |
image | string | object | — | Product image — a URL string or a full ImageObject with url, width, and height. |
description | string | — | A description of the product. |
brand.name | string | — | The name of the product's brand. |
sku | string | — | Stock Keeping Unit — a unique identifier for the product. |
gtin | string | — | Global Trade Item Number (covers GTIN-8, GTIN-13, GTIN-14). |
mpn | string | — | Manufacturer Part Number. |
offers.price | string | — | The price of the product, e.g. "29.99". |
offers.priceCurrency | string | — | ISO 4217 currency code, e.g. "USD". |
offers.availability | string | — | Product availability status (e.g. InStock, OutOfStock, PreOrder). |
offers.url | string | — | URL of the product offer page. |
offers.itemCondition | string | — | Condition of the product (e.g. NewCondition, UsedCondition, RefurbishedCondition). |
aggregateRating.ratingValue | string | — | The average rating, e.g. "4.5". |
aggregateRating.reviewCount | string | — | Total number of reviews. |
aggregateRating.bestRating | string | — | The highest possible rating, e.g. "5". |
review[].author | string | — | The name of the reviewer. |
review[].reviewRating | string | — | The rating given in this review, e.g. "5". |
review[].reviewBody | string | — | The full text of the review. |
Plugin Registration
sanity.config.ts
import { defineConfig } from "sanity";
import { schemaOrgProductPlugin } from "sanity-plugin-seofields/schema";
export default defineConfig({
// ... your project config
plugins: [
schemaOrgProductPlugin(),
],
});Schema Usage
Add the schemaOrgProduct field to any document schema:
schemas/page.ts
import { defineField, defineType } from 'sanity'
export default defineType({
name: 'page',
title: 'Page',
type: 'document',
fields: [
// ... your other fields
defineField({
name: 'schemaOrgProduct',
title: 'Product Schema',
type: 'schemaOrgProduct',
}),
],
})GROQ Query
GROQ query
*[_type == "yourDocument"][0]{
schemaOrgProduct {
name,
image,
description,
brand {
name
},
sku,
gtin,
mpn,
offers {
price,
priceCurrency,
availability,
url,
itemCondition
},
aggregateRating {
ratingValue,
reviewCount,
bestRating
},
review[] {
author,
reviewRating,
reviewBody
}
}
}Next.js Component
app/layout.tsx
import { ProductSchema } from "sanity-plugin-seofields/schema/next";
export default function Layout({ children }: { children: React.ReactNode }) {
// Fetch your product data from Sanity
const product = await sanityClient.fetch(query);
return (
<html lang="en">
<body>
<ProductSchema data={product.product} />
{children}
</body>
</html>
);
}JSON-LD Output
Generated JSON-LD
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Wireless Noise-Cancelling Headphones",
"image": "https://example.com/headphones.jpg",
"description": "Premium wireless headphones with active noise cancellation and 30-hour battery life.",
"brand": {
"@type": "Brand",
"name": "SoundMax"
},
"sku": "WH-1000XM5",
"gtin": "4549292196405",
"mpn": "WH1000XM5/B",
"offers": {
"@type": "Offer",
"price": "349.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock",
"url": "https://example.com/products/headphones",
"itemCondition": "https://schema.org/NewCondition"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.8",
"reviewCount": "2847",
"bestRating": "5"
},
"review": [
{
"@type": "Review",
"author": "John Smith",
"reviewRating": "5",
"reviewBody": "Best headphones I have ever used. The noise cancellation is incredible."
}
]
}Last updated: May 27, 2026. Tested with: Sanity Studio v3, v4, and v5.
Was this page helpful?