> ## Documentation Index
> Fetch the complete documentation index at: https://learn.orbexa.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Schema.org结构化数据标记实战教程

> Schema.org结构化数据标记实战教程，手把手教你用JSON-LD格式让ChatGPT和Claude等AI代理准确理解商品信息与公司实体关系，覆盖Product、Organization、BreadcrumbList等电商核心标记类型的完整代码示例，附必填与推荐字段说明及常见标记错误排查方法

# Schema.org 实战

## 3.1 什么是Schema.org

[Schema.org](https://schema.org) 是由Google、Microsoft、Yahoo、Yandex联合创建的结构化数据标准。它定义了一套统一的词汇表，让网页内容变成机器可读的。

**通俗解释**: 你的网页上写着"Nike Air Max 90，￥899，有库存"。人能读懂，但机器看到的只是一段文本。Schema.org标记告诉机器：这是一个"Product"，名字是"Nike Air Max 90"，价格是"899 CNY"，库存状态是"InStock"。

**对AI代理的影响**: AI代理（ChatGPT、Claude、Gemini等）在推荐商品时，优先处理有结构化数据的页面，因为它们能准确提取商品信息，减少误解和幻觉。

## 3.2 Schema.org的三种实现格式

| 格式            | 推荐程度 | 说明                                     |
| ------------- | ---- | -------------------------------------- |
| **JSON-LD**   | 推荐   | Google官方推荐。独立的 `<script>` 标签，不影响HTML结构 |
| **Microdata** | 可用   | 内嵌在HTML标签属性中（`itemprop`、`itemscope`）   |
| **RDFa**      | 不推荐  | 较旧的格式，使用率低                             |

**为什么推荐JSON-LD**:

* 和HTML完全分离，维护方便
* 可以用后端动态生成
* AI代理解析效率最高
* Google官方明确推荐

## 3.3 电商必备：Product标记

一个完整的Product标记示例：

```json theme={null}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "经典帆布运动鞋",
  "description": "舒适透气的经典帆布鞋，适合日常穿着。",
  "image": [
    "https://example.com/photos/shoe-1.jpg",
    "https://example.com/photos/shoe-2.jpg"
  ],
  "brand": {
    "@type": "Brand",
    "name": "ExampleBrand"
  },
  "sku": "SHOE-001",
  "gtin13": "1234567890123",
  "offers": {
    "@type": "Offer",
    "url": "https://example.com/shoe-001",
    "priceCurrency": "CNY",
    "price": "299.00",
    "availability": "https://schema.org/InStock",
    "seller": {
      "@type": "Organization",
      "name": "Example Store"
    },
    "shippingDetails": {
      "@type": "OfferShippingDetails",
      "shippingDestination": {
        "@type": "DefinedRegion",
        "addressCountry": "CN"
      },
      "deliveryTime": {
        "@type": "ShippingDeliveryTime",
        "businessDays": {
          "@type": "QuantitativeValue",
          "minValue": 1,
          "maxValue": 3
        }
      }
    },
    "hasMerchantReturnPolicy": {
      "@type": "MerchantReturnPolicy",
      "returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow",
      "merchantReturnDays": 30
    }
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.6",
    "reviewCount": "128"
  }
}
</script>
```

**必填字段清单**:

| 字段                        | 重要性  | 说明                 |
| ------------------------- | ---- | ------------------ |
| `name`                    | 必填   | 商品名称               |
| `description`             | 必填   | 商品描述               |
| `image`                   | 必填   | 至少一张高质量图片URL       |
| `offers.price`            | 必填   | 价格                 |
| `offers.priceCurrency`    | 必填   | 货币代码（CNY/USD/EUR等） |
| `offers.availability`     | 必填   | 库存状态               |
| `brand`                   | 强烈推荐 | 品牌名称               |
| `sku`                     | 推荐   | 商品唯一编号             |
| `gtin13` / `gtin14`       | 推荐   | 国际商品条码             |
| `aggregateRating`         | 推荐   | 评分汇总               |
| `shippingDetails`         | 推荐   | 配送信息               |
| `hasMerchantReturnPolicy` | 推荐   | 退货政策               |

## 3.4 公司信息：Organization标记

除了商品，你的公司信息也需要结构化。放在首页或"关于我们"页面：

```json theme={null}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "公司名称",
  "url": "https://example.com",
  "logo": "https://example.com/logo.png",
  "description": "一句话描述公司业务",
  "foundingDate": "2020-01-01",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "具体地址",
    "addressLocality": "城市",
    "addressRegion": "省份",
    "postalCode": "邮编",
    "addressCountry": "CN"
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer service",
    "email": "support@example.com",
    "telephone": "+86-xxx-xxxx-xxxx"
  },
  "sameAs": [
    "https://weibo.com/example",
    "https://www.linkedin.com/company/example"
  ]
}
</script>
```

## 3.5 面包屑导航：BreadcrumbList

帮助AI代理理解你的网站结构层级：

```json theme={null}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "首页",
      "item": "https://example.com"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "运动鞋",
      "item": "https://example.com/category/sneakers"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "经典帆布运动鞋"
    }
  ]
}
</script>
```

## 3.6 常见错误

| 错误         | 后果        | 修复方法                 |
| ---------- | --------- | -------------------- |
| 价格缺少货币代码   | AI无法比价    | 始终填写 `priceCurrency` |
| 库存状态缺失     | AI不知道能不能买 | 动态更新 `availability`  |
| 图片用相对路径    | AI抓取失败    | 使用完整的 `https://` URL |
| 标记和页面内容不一致 | 被搜索引擎惩罚   | 保持标记数据和可见内容一致        |
| 嵌套JSON格式错误 | 解析失败      | 用验证工具检查              |

## 3.7 验证工具

配置完Schema.org标记后，用以下工具验证：

1. **[Google Rich Results Test](https://search.google.com/test/rich-results)** — 检测标记是否正确，是否能触发富结果
2. **[Schema.org Validator](https://validator.schema.org/)** — 官方验证工具
3. **浏览器开发者工具** — 查看页面源代码中的 `<script type="application/ld+json">` 内容

## 3.8 自检清单

* [ ] 每个商品页面都有 `Product` JSON-LD标记
* [ ] Product标记包含name、description、image、price、availability
* [ ] 首页或关于页有 `Organization` JSON-LD标记
* [ ] 分类页面有 `BreadcrumbList` 标记
* [ ] 用Google Rich Results Test验证至少3个页面
* [ ] 标记数据和页面可见内容一致

***

**下一章**: [JSON-LD vs Microdata](/zh/book-6/ch4-jsonld-vs-microdata) — 两种格式的技术对比和迁移指南
