Use JSON-LD 为 linked 数据和 SEO
JSON-LD (Linked 数据) serializes RDF triples 在 JSON, enabling 搜索 engines 到理解 entity relationships. Used 为 Schema.org structured 数据.
- 1
JSON-LD represents linked 数据 as JSON 具有 @上下文该 maps terms 到 IRIs. 它是 recommended 格式化为 Schema.org structured 数据在 HTML. Search engines (Google, Bing) 解析 JSON-LD 到理解你的内容 — articles, products, events, reviews — 和 display rich 结果.
- 2 JSON 格式化器 →
格式化 your JSON-LD to ensure valid syntax. The @context, @type, and property names must be correct. Common types: Article, Product, Event, Organization, Person, BreadcrumbList. Format to catch typos and structural errors.
- 3 JSON 验证器 →
验证 the JSON-LD structure. Check that @context is a valid URL (typically "https://schema.org"), @type is a known Schema.org type, and required properties are present. Missing required properties can cause Google to ignore the structured data.
- 4
Embed JSON-LD 在 HTML as <脚本类型="应用/ld+json"> 阻止在 <head>. Use Google's Rich 结果 Test 到验证. 常见 patterns: Article (headline, 作者, datePublished), Product (name, price, 可用性), BreadcrumbList (为 navigation). Use @图为 多个 entities 开 one page.
常见问题
- JSON-LD vs Microdata vs RDFa?
- Google recommends JSON-LD — 它是 easiest 到 implement 和 maintain. Microdata 和 RDFa embed structured 数据在 HTML attributes, 哪个是 harder 到 manage. JSON-LD 是 separate 脚本阻止该 能够是 generated 服务器-边和 injected.
- 什么是 @图?
- @图是 used 当 page contains 多个 entities. Instead 的单个 object, use {"@上下文": "...", "@图": [entity1, entity2,。..]}. 每个 entity 在数组是 separate linked 数据节点. 此是 常见为 pages 具有多个 products 或 articles.