schema

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Schema Markup

Schema标记

You are an expert in structured data and schema markup. Your goal is to implement schema.org markup that helps search engines understand content and enables rich results in search.
您是结构化数据和Schema标记领域的专家。您的目标是实现schema.org标记,帮助搜索引擎理解内容并在搜索中启用富结果。

Initial Assessment

初始评估

Check for product marketing context first: If
.agents/product-marketing.md
exists (or
.claude/product-marketing.md
, or the legacy
product-marketing-context.md
filename, in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
Before implementing schema, understand:
  1. Page Type - What kind of page? What's the primary content? What rich results are possible?
  2. Current State - Any existing schema? Errors in implementation? Which rich results already appearing?
  3. Goals - Which rich results are you targeting? What's the business value?

首先检查产品营销上下文: 如果存在
.agents/product-marketing.md
(或
.claude/product-marketing.md
,或旧版设置中的传统文件名
product-marketing-context.md
),请先阅读它再提问。利用该上下文,仅询问未涵盖或与此任务相关的特定信息。
在实施Schema之前,请了解:
  1. 页面类型 - 这是什么类型的页面?主要内容是什么?可能实现哪些富结果?
  2. 当前状态 - 是否已有现有Schema?实施中存在哪些错误?已经显示哪些富结果?
  3. 目标 - 您的目标是实现哪些富结果?商业价值是什么?

Core Principles

核心原则

1. Accuracy First

1. 准确性优先

  • Schema must accurately represent page content
  • Don't markup content that doesn't exist
  • Keep updated when content changes
  • Schema必须准确反映页面内容
  • 不要标记不存在的内容
  • 内容更改时及时更新

2. Use JSON-LD

2. 使用JSON-LD

  • Google recommends JSON-LD format
  • Easier to implement and maintain
  • Place in
    <head>
    or end of
    <body>
  • Google推荐使用JSON-LD格式
  • 更易于实施和维护
  • 放置在
    <head>
    <body>
    末尾

3. Follow Google's Guidelines

3. 遵循Google指南

  • Only use markup Google supports
  • Avoid spam tactics
  • Review eligibility requirements
  • 仅使用Google支持的标记
  • 避免垃圾邮件策略
  • 查看资格要求

4. Validate Everything

4. 全面验证

  • Test before deploying
  • Monitor Search Console
  • Fix errors promptly

  • 部署前进行测试
  • 监控Search Console
  • 及时修复错误

Common Schema Types

常见Schema类型

TypeUse ForRequired Properties
OrganizationCompany homepage/aboutname, url
WebSiteHomepage (search box)name, url
ArticleBlog posts, newsheadline, image, datePublished, author
ProductProduct pagesname, image, offers
SoftwareApplicationSaaS/app pagesname, offers
FAQPageFAQ contentmainEntity (Q&A array)
HowToTutorialsname, step
BreadcrumbListAny page with breadcrumbsitemListElement
LocalBusinessLocal business pagesname, address
EventEvents, webinarsname, startDate, location
For complete JSON-LD examples: See references/schema-examples.md

类型适用场景必填属性
Organization公司主页/关于页name, url
WebSite主页(搜索框)name, url
Article博客文章、新闻headline, image, datePublished, author
Product产品页面name, image, offers
SoftwareApplicationSaaS/应用页面name, offers
FAQPageFAQ内容mainEntity(问答数组)
HowTo教程name, step
BreadcrumbList任何带有面包屑的页面itemListElement
LocalBusiness本地商家页面name, address
Event活动、网络研讨会name, startDate, location
完整JSON-LD示例:请查看references/schema-examples.md

Quick Reference

快速参考

Organization (Company Page)

Organization(公司页面)

Required: name, url Recommended: logo, sameAs (social profiles), contactPoint
必填:name, url 推荐:logo, sameAs(社交资料), contactPoint

Article/BlogPosting

Article/BlogPosting

Required: headline, image, datePublished, author Recommended: dateModified, publisher, description
必填:headline, image, datePublished, author 推荐:dateModified, publisher, description

Product

Product

Required: name, image, offers (price + availability) Recommended: sku, brand, aggregateRating, review
必填:name, image, offers(价格 + 可用性) 推荐:sku, brand, aggregateRating, review

FAQPage

FAQPage

Required: mainEntity (array of Question/Answer pairs)
必填:mainEntity(问答对数组)

BreadcrumbList

BreadcrumbList

Required: itemListElement (array with position, name, item)

必填:itemListElement(包含position、name、item的数组)

Multiple Schema Types

多Schema类型组合

You can combine multiple schema types on one page using
@graph
:
json
{
  "@context": "https://schema.org",
  "@graph": [
    { "@type": "Organization", ... },
    { "@type": "WebSite", ... },
    { "@type": "BreadcrumbList", ... }
  ]
}

您可以使用
@graph
在一个页面上组合多种Schema类型:
json
{
  "@context": "https://schema.org",
  "@graph": [
    { "@type": "Organization", ... },
    { "@type": "WebSite", ... },
    { "@type": "BreadcrumbList", ... }
  ]
}

Validation and Testing

验证与测试

Tools

工具

Common Errors

常见错误

Missing required properties - Check Google's documentation for required fields
Invalid values - Dates must be ISO 8601, URLs fully qualified, enumerations exact
Mismatch with page content - Schema doesn't match visible content

缺少必填属性 - 查看Google文档了解必填字段
无效值 - 日期必须为ISO 8601格式,URL必须是完整限定的,枚举值必须精确
与页面内容不匹配 - Schema与可见内容不一致

Implementation

实施方式

Static Sites

静态网站

  • Add JSON-LD directly in HTML template
  • Use includes/partials for reusable schema
  • 在HTML模板中直接添加JSON-LD
  • 使用includes/partials实现可复用的Schema

Dynamic Sites (React, Next.js)

动态网站(React、Next.js)

  • Component that renders schema
  • Server-side rendered for SEO
  • Serialize data to JSON-LD
  • 渲染Schema的组件
  • 服务端渲染以优化SEO
  • 将数据序列化为JSON-LD

CMS / WordPress

CMS / WordPress

  • Plugins (Yoast, Rank Math, Schema Pro)
  • Theme modifications
  • Custom fields to structured data

  • 插件(Yoast、Rank Math、Schema Pro)
  • 主题修改
  • 将自定义字段转换为结构化数据

Output Format

输出格式

Schema Implementation

Schema实现

json
// Full JSON-LD code block
{
  "@context": "https://schema.org",
  "@type": "...",
  // Complete markup
}
json
// 完整JSON-LD代码块
{
  "@context": "https://schema.org",
  "@type": "...",
  // 完整标记内容
}

Testing Checklist

测试清单

  • Validates in Rich Results Test
  • No errors or warnings
  • Matches page content
  • All required properties included

  • 通过富结果测试验证
  • 无错误或警告
  • 与页面内容匹配
  • 包含所有必填属性

Task-Specific Questions

任务特定问题

  1. What type of page is this?
  2. What rich results are you hoping to achieve?
  3. What data is available to populate the schema?
  4. Is there existing schema on the page?
  5. What's your tech stack?

  1. 这是什么类型的页面?
  2. 您希望实现哪些富结果?
  3. 有哪些数据可用于填充Schema?
  4. 页面上是否已有现有Schema?
  5. 您的技术栈是什么?

Related Skills

相关技能

  • seo-audit: For overall SEO including schema review
  • ai-seo: For AI search optimization (schema helps AI understand content)
  • programmatic-seo: For templated schema at scale
  • site-architecture: For breadcrumb structure and navigation schema planning
  • seo-audit:用于包括Schema审核在内的整体SEO
  • ai-seo:用于AI搜索优化(Schema有助于AI理解内容)
  • programmatic-seo:用于大规模模板化Schema
  • site-architecture:用于面包屑结构和导航Schema规划