结构化数据与 Schema 标记 结构化数据(Structured Data)是用机器可读格式描述页面内容的标记。它让搜索引擎与 AI 不再「猜测」页面在讲什么,而是「确切知道」每个实体的属性。本章覆盖 Schema.org 类型选型、JSON-LD 多类型代码示例、验证流程与 Google 政策红线,是技术 SEO 与 GEO 共用的关键技能。 一、什么是结构化数据,为什么重要 传统 HTML 页面对人类可读,对机器却是「非结构化」的——爬虫需要通过文本分析猜测「这段是价格」「这个数字是评分」。结构化数据通过标准化的标记,把页面内容的语义显式声明出来。
结构化数据(Structured Data)是用机器可读格式描述页面内容的标记。它让搜索引擎与 AI 不再「猜测」页面在讲什么,而是「确切知道」每个实体的属性。本章覆盖 Schema.org 类型选型、JSON-LD 多类型代码示例、验证流程与 Google 政策红线,是技术 SEO 与 GEO 共用的关键技能。
传统 HTML 页面对人类可读,对机器却是「非结构化」的——爬虫需要通过文本分析猜测「这段是价格」「这个数字是评分」。结构化数据通过标准化的标记,把页面内容的语义显式声明出来。
它的核心价值:
Schema.org 是 Google、Microsoft、Yahoo、Yandex 于 2011 年联合发起的统一词汇表,定义了实体类型与属性。它是结构化数据的标准词汇。
| 格式 | 写法 | 推荐度 | 说明 |
|---|---|---|---|
| JSON-LD | <script type="application/ld+json"> |
⭐⭐⭐⭐⭐ Google 首选 | 独立于 HTML 结构,易维护 |
| Microdata | HTML 标签内 itemprop |
⭐⭐ | 老旧,不推荐新项目使用 |
| RDFa | HTML 标签内 vocab/property |
⭐ | 较少使用 |
Google 官方明确推荐 JSON-LD。本章所有代码示例均使用 JSON-LD。
JSON-LD 是一段 JSON,描述一个或多个「实体」。基本元素:
@context:声明词汇表,固定为 https://schema.org。@type:实体类型(如 Article、Product、FAQPage)。<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "headline": "SEO 实战指南", "author": { "@type": "Person", "name": "张三" }, "datePublished": "2026-07-01" } </script>
不同页面类型适用不同 Schema。先选对类型,再填充属性。
| 页面类型 | 推荐 Schema 类型 | 富媒体收益 |
|---|---|---|
| 文章/博客 | Article、BlogPosting、NewsArticle |
作者、日期、缩略图 |
| 组织/公司 | Organization |
知识面板、Logo |
| 本地商家 | LocalBusiness |
营业时间、地址、评价 |
| 商品 | Product + Offer |
价格、库存、评分 |
| FAQ 页 | FAQPage |
可展开的问答折叠 |
| 操作指南 | HowTo |
步骤展示 |
| 评论 | Review、AggregateRating |
星级评分 |
| 面包屑 | BreadcrumbList |
富媒体面包屑 |
| 视频 | VideoObject |
视频预览、时长 |
| 活动 | Event |
日期、地点、票价 |
| 食谱 | Recipe |
烹饪时间、营养、评分 |
| 人员 | Person |
作者实体 |
下面给出 7 种最常用 Schema 的完整 JSON-LD 示例,可直接复制修改。
放在全站页脚或首页,声明品牌实体。这是构建知识图谱的起点。
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Organization", "@id": "https://example.com/#organization", "name": "示例科技公司", "alternateName": "ExampleTech", "url": "https://example.com", "logo": { "@type": "ImageObject", "url": "https://example.com/logo.png", "width": 512, "height": 512 }, "description": "提供 SEO 与 GEO 优化服务的技术公司", "foundingDate": "2020-01-01", "sameAs": [ "https://www.linkedin.com/company/exampletech", "https://twitter.com/exampletech", "https://www.wikidata.org/wiki/Q123456789" ], "contactPoint": { "@type": "ContactPoint", "telephone": "+86-10-12345678", "contactType": "customer service", "areaServed": "CN", "availableLanguage": ["Chinese", "English"] } } </script>
关键属性说明:
@id:实体的唯一标识,全站统一,便于其他实体引用。sameAs:指向品牌在其他平台的权威页面(LinkedIn、Wikidata、维基),是实体对齐的关键——把你在全网的身份「缝合」成一个实体。<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "headline": "2026 年 SEO 与 GEO 实战指南", "description": "一份覆盖技术与内容双轨的搜索引擎优化实战手册", "image": "https://example.com/images/seo-guide-cover.jpg", "datePublished": "2026-07-01T08:00:00+08:00", "dateModified": "2026-07-10T10:00:00+08:00", "author": { "@type": "Person", "@id": "https://example.com/author/zhangsan", "name": "张三", "jobTitle": "资深 SEO 顾问", "url": "https://example.com/author/zhangsan" }, "publisher": { "@type": "Organization", "@id": "https://example.com/#organization" }, "mainEntityOfPage": { "@type": "WebPage", "@id": "https://example.com/article/seo-guide" } } </script>
FAQ Schema 能在 SERP 中生成可展开的问答,对 AI 也极具可引用性(定义式问答是 AI 最爱抽取的单元)。
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "SEO 和 GEO 的区别是什么?", "acceptedAnswer": { "@type": "Answer", "text": "SEO 优化网页在传统搜索引擎中的排名,目标是获取点击流量;GEO 优化内容被生成式 AI 引用的概率,目标是在 AI 答案中获得品牌曝光。两者共享技术 SEO 与 E-E-A-T 地基。" } }, { "@type": "Question", "name": "GEO 需要屏蔽 AI 爬虫吗?", "acceptedAnswer": { "@type": "Answer", "text": "不建议一刀切屏蔽。放行主流 AI 爬虫(GPTBot、PerplexityBot)可获得被引用机会。仅对付费墙或敏感内容按需屏蔽。" } } ] } </script>
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Product", "name": "降噪耳机 Pro X", "image": "https://example.com/images/headphone-prox.jpg", "description": "主动降噪、40 小时续航的无线降噪耳机", "brand": { "@type": "Brand", "name": "示例音频" }, "sku": "HP-PROX-001", "mpn": "MPN123456", "offers": { "@type": "Offer", "url": "https://example.com/products/headphone-prox", "priceCurrency": "CNY", "price": "1299.00", "priceValidUntil": "2026-12-31", "availability": "https://schema.org/InStock", "itemCondition": "https://schema.org/NewCondition", "seller": { "@type": "Organization", "@id": "https://example.com/#organization" } }, "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.7", "reviewCount": "1280" } } </script>
⚠️ 评分与评论数据必须真实可验证,Google 对虚假评分有严格惩罚。
<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": "SEO 指南", "item": "https://example.com/seo-guide" }, { "@type": "ListItem", "position": 3, "name": "结构化数据" } ] } </script>
最后一项(当前页)通常不加
item属性,或省略。
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "HowTo", "name": "如何配置 robots.txt 放行 AI 爬虫", "description": "本指南教你分层放行主流 AI 爬虫", "totalTime": "PT10M", "step": [ { "@type": "HowToStep", "position": 1, "name": "定位 robots.txt", "text": "在网站根目录创建或编辑 robots.txt 文件。" }, { "@type": "HowToStep", "position": 2, "name": "添加 GPTBot 放行规则", "text": "在文件中添加 User-agent: GPTBot 后跟 Allow: /" }, { "@type": "HowToStep", "position": 3, "name": "验证", "text": "用 Google Rich Results Test 验证文件可被正确解析。" } ] } </script>
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Review", "itemReviewed": { "@type": "Product", "name": "降噪耳机 Pro X" }, "reviewRating": { "@type": "Rating", "ratingValue": "5", "bestRating": "5" }, "author": { "@type": "Person", "name": "李四" }, "datePublished": "2026-06-15", "reviewBody": "降噪效果出色,续航达标,值得推荐。" } </script>
一个页面可以包含多个 JSON-LD 脚本,或用 @graph 把多个实体组织在一起。例如文章页同时声明 Article + BreadcrumbList + Organization:
<script type="application/ld+json"> { "@context": "https://schema.org", "@graph": [ { "@type": "Organization", "@id": "https://example.com/#organization", "name": "示例科技公司", "url": "https://example.com" }, { "@type": "Article", "headline": "SEO 实战指南", "author": { "@type": "Person", "name": "张三" }, "publisher": { "@id": "https://example.com/#organization" } }, { "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "首页", "item": "https://example.com/" }, { "@type": "ListItem", "position": 2, "name": "SEO 指南" } ] } ] } </script>
用 @graph 的好处:实体间通过 @id 互相引用,构建出清晰的实体关系网络,对知识图谱与 AI 理解尤为有利。
写完结构化数据必须验证。两个官方工具:
| 工具 | 用途 |
|---|---|
| Rich Results Test | 验证 JSON-LD 是否符合 Google 富媒体结果要求,预览 SERP 展示 |
| Schema Markup Validator | 验证 Schema 语法正确性(不限于 Google 富媒体) |
验证流程:
部署后,在 GSC「商家信息」「富媒体搜索结果」报告中监控:
| 错误/违规 | 后果 | 纠正 |
|---|---|---|
| 标记的数据与页面可见内容不符 | 触发手动操作 | 标记必须反映页面真实内容 |
| 虚假评分/评论 | 严重惩罚,取消富媒体资格 | 只标记真实用户评论 |
| 标记首页所有类型(堆砌) | 被视为操纵 | 按页面真实类型精准标记 |
| 必填属性缺失 | 不触发富媒体 | 补全 name/image/price 等必填项 |
| JSON 语法错误(尾逗号等) | 整段失效 | 用 JSON 校验器检查 |
| 日期格式不标准 | 不被识别 | 用 ISO 8601(2026-07-01 或带时区) |
| Logo 尺寸不合规 | 不显示 | 至少 112×112px,建议 512×512px |
结构化数据对 GEO 的价值甚至超过传统 SEO:
price、ratingValue、foundingDate 显式声明属性时,AI 引用时几乎不会出错。sameAs 指向 Wikidata、维基百科,帮助 AI 把你的品牌「对齐」到知识图谱中的正确实体。实操建议:对所有核心内容页,至少做到「内容类型 + 实体身份」两层标记。例如文章页必有 Article + 作者 Person + 发布 Organization;商品页必有 Product + Offer + Brand。
| 误区 | 纠正 |
|---|---|
| 「加了 Schema 就能排名靠前」 | Schema 不是直接排名因素,但能争取富媒体、帮助理解 |
| 「Schema 越多越好」 | 堆砌无关 Schema 触发操纵判定,精准才有效 |
| 「Microdata 和 JSON-LD 效果一样」 | 效果类似,但 JSON-LD 更易维护,Google 推荐 |
| 「评分可以自己写」 | 虚假评分是重违规,会被取消资格并惩罚 |
| 「结构化数据不需要维护」 | 页面改版后需同步更新,否则会报错或失真 |
结构化数据让内容从「人类可读」升级为「机器可懂」,是 SEO 争取富媒体结果、GEO 提升 AI 引用准确性的共同利器。掌握 JSON-LD 的写法、按页面类型选对 Schema、用 @graph 构建实体关系、用 Rich Results Test 验证、在 GSC 持续监控——这套流程应成为每个核心页面的标配。
至此,02 章技术架构优化全部讲完:抓取与索引(02-01)、架构与 URL(02-02)、性能 CWV(02-03)、结构化数据(02-04)构成了「让网站可抓取、可索引、可排序、可被 AI 读懂」的完整技术地基。技术地基夯实后,下一章我们将进入内容层面——如何用关键词工程与主题集群构建内容壁垒(03 章)。