---
title: "Product Schema"
description: "Add Product structured data to Sanity documents — enable Google Shopping rich results with price, availability, reviews, and brand details using schema.org markup."
canonical: https://sanity-plugin-seofields.thehardik.in/docs/schema-org/product
---

# 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 | Yes | The name of the product. |
| `image` | string \| object | No | Product image — a URL string or a full ImageObject with url, width, and height. |
| `description` | string | No | A description of the product. |
| `brand.name` | string | No | The name of the product's brand. |
| `sku` | string | No | Stock Keeping Unit — a unique identifier for the product. |
| `gtin` | string | No | Global Trade Item Number (covers GTIN-8, GTIN-13, GTIN-14). |
| `mpn` | string | No | Manufacturer Part Number. |
| `offers.price` | string | No | The price of the product, e.g. "29.99". |
| `offers.priceCurrency` | string | No | ISO 4217 currency code, e.g. "USD". |
| `offers.availability` | string | No | Product availability status (e.g. InStock, OutOfStock, PreOrder). |
| `offers.url` | string | No | URL of the product offer page. |
| `offers.itemCondition` | string | No | Condition of the product (e.g. NewCondition, UsedCondition, RefurbishedCondition). |
| `aggregateRating.ratingValue` | string | No | The average rating, e.g. "4.5". |
| `aggregateRating.reviewCount` | string | No | Total number of reviews. |
| `aggregateRating.bestRating` | string | No | The highest possible rating, e.g. "5". |
| `review[].author` | string | No | The name of the reviewer. |
| `review[].reviewRating` | string | No | The rating given in this review, e.g. "5". |
| `review[].reviewBody` | string | No | The full text of the review. |

## Plugin Registration

```typescript
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:

```typescript
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

```javascript
*[_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

```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

```json
{
  "@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."
    }
  ]
}
```
