schema-markup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSchema 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 exists, read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
.claude/product-marketing-context.mdBefore implementing schema, understand:
-
Page Type - What kind of page? What's the primary content? What rich results are possible?
-
Current State - Any existing schema? Errors in implementation? Which rich results already appearing?
-
Goals - Which rich results are you targeting? What's the business value?
首先检查产品营销背景:
如果存在文件,请在提问前先行阅读。利用该背景信息,仅询问未涵盖的内容或与本任务相关的特定信息。
.claude/product-marketing-context.md在实施Schema之前,请了解以下内容:
-
页面类型 - 这是什么类型的页面?主要内容是什么?可实现哪些富结果?
-
当前状态 - 是否已存在现有Schema?实施过程中存在哪些错误?目前已呈现哪些富结果?
-
目标 - 您希望实现哪些富结果?对应的商业价值是什么?
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必须准确反映页面内容
- 不得标记不存在的内容
- 内容变更时及时更新Schema
2. Use JSON-LD
2. 使用JSON-LD
- Google recommends JSON-LD format
- Easier to implement and maintain
- Place in or end of
<head><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类型
| Type | Use For | Required Properties |
|---|---|---|
| Organization | Company homepage/about | name, url |
| WebSite | Homepage (search box) | name, url |
| Article | Blog posts, news | headline, image, datePublished, author |
| Product | Product pages | name, image, offers |
| SoftwareApplication | SaaS/app pages | name, offers |
| FAQPage | FAQ content | mainEntity (Q&A array) |
| HowTo | Tutorials | name, step |
| BreadcrumbList | Any page with breadcrumbs | itemListElement |
| LocalBusiness | Local business pages | name, address |
| Event | Events, webinars | name, 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 |
| SoftwareApplication | SaaS/应用页面 | name, offers |
| FAQPage | FAQ内容板块 | 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 :
@graphjson
{
"@context": "https://schema.org",
"@graph": [
{ "@type": "Organization", ... },
{ "@type": "WebSite", ... },
{ "@type": "BreadcrumbList", ... }
]
}您可以使用在单个页面上组合多个Schema类型:
@graphjson
{
"@context": "https://schema.org",
"@graph": [
{ "@type": "Organization", ... },
{ "@type": "WebSite", ... },
{ "@type": "BreadcrumbList", ... }
]
}Validation and Testing
验证与测试
Tools
工具
- Google Rich Results Test: https://search.google.com/test/rich-results
- Schema.org Validator: https://validator.schema.org/
- Search Console: Enhancements reports
- Google富结果测试:https://search.google.com/test/rich-results
- Schema.org验证器:https://validator.schema.org/
- Search Console:增强功能报告
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
任务特定问题
- What type of page is this?
- What rich results are you hoping to achieve?
- What data is available to populate the schema?
- Is there existing schema on the page?
- What's your tech stack?
- 这是什么类型的页面?
- 您希望实现哪些富结果?
- 有哪些可用于填充Schema的数据?
- 页面上是否已有现有Schema?
- 您使用的技术栈是什么?
Related Skills
相关技能
- seo-audit: For overall SEO including schema review
- programmatic-seo: For templated schema at scale
- seo-audit:用于包含Schema审核的整体SEO检查
- programmatic-seo:用于大规模模板化Schema