tool-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
初始评估
Before implementing schema, understand:
-
Page Type
- What kind of page is this?
- What's the primary content?
- What rich results are possible?
-
Current State
- Any existing schema?
- Errors in current implementation?
- Which rich results are already appearing?
-
Goals
- Which rich results are you targeting?
- What's the business value?
在实现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类型
Organization
Organization(组织)
Use for: Company/brand homepage or about page
Required properties:
- name
- url
Recommended properties:
- logo
- sameAs (social profiles)
- contactPoint
json
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Company",
"url": "https://example.com",
"logo": "https://example.com/logo.png",
"sameAs": [
"https://twitter.com/example",
"https://linkedin.com/company/example",
"https://facebook.com/example"
],
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1-555-555-5555",
"contactType": "customer service"
}
}适用场景:公司/品牌首页或关于页
必填属性:
- name
- url
推荐属性:
- logo
- sameAs(社交平台链接)
- contactPoint
json
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Company",
"url": "https://example.com",
"logo": "https://example.com/logo.png",
"sameAs": [
"https://twitter.com/example",
"https://linkedin.com/company/example",
"https://facebook.com/example"
],
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1-555-555-5555",
"contactType": "customer service"
}
}WebSite (with SearchAction)
WebSite(含SearchAction)
Use for: Homepage, enables sitelinks search box
Required properties:
- name
- url
For search box:
- potentialAction with SearchAction
json
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "Example",
"url": "https://example.com",
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://example.com/search?q={search_term_string}"
},
"query-input": "required name=search_term_string"
}
}适用场景:首页,用于启用站点链接搜索框
必填属性:
- name
- url
搜索框配置:
- 带SearchAction的potentialAction
json
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "Example",
"url": "https://example.com",
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://example.com/search?q={search_term_string}"
},
"query-input": "required name=search_term_string"
}
}Article / BlogPosting
Article / BlogPosting(文章/博客)
Use for: Blog posts, news articles
Required properties:
- headline
- image
- datePublished
- author
Recommended properties:
- dateModified
- publisher
- description
- mainEntityOfPage
json
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Implement Schema Markup",
"image": "https://example.com/image.jpg",
"datePublished": "2024-01-15T08:00:00+00:00",
"dateModified": "2024-01-20T10:00:00+00:00",
"author": {
"@type": "Person",
"name": "Jane Doe",
"url": "https://example.com/authors/jane"
},
"publisher": {
"@type": "Organization",
"name": "Example Company",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png"
}
},
"description": "A complete guide to implementing schema markup...",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.com/schema-guide"
}
}适用场景:博客文章、新闻报道
必填属性:
- headline
- image
- datePublished
- author
推荐属性:
- dateModified
- publisher
- description
- mainEntityOfPage
json
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Implement Schema Markup",
"image": "https://example.com/image.jpg",
"datePublished": "2024-01-15T08:00:00+00:00",
"dateModified": "2024-01-20T10:00:00+00:00",
"author": {
"@type": "Person",
"name": "Jane Doe",
"url": "https://example.com/authors/jane"
},
"publisher": {
"@type": "Organization",
"name": "Example Company",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png"
}
},
"description": "A complete guide to implementing schema markup...",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.com/schema-guide"
}
}Product
Product(产品)
Use for: Product pages (e-commerce or SaaS)
Required properties:
- name
- image
- offers (with price and availability)
Recommended properties:
- description
- sku
- brand
- aggregateRating
- review
json
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Premium Widget",
"image": "https://example.com/widget.jpg",
"description": "Our best-selling widget for professionals",
"sku": "WIDGET-001",
"brand": {
"@type": "Brand",
"name": "Example Co"
},
"offers": {
"@type": "Offer",
"url": "https://example.com/products/widget",
"priceCurrency": "USD",
"price": "99.99",
"availability": "https://schema.org/InStock",
"priceValidUntil": "2024-12-31"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.8",
"reviewCount": "127"
}
}适用场景:产品页面(电商或SaaS)
必填属性:
- name
- image
- offers(含价格和库存状态)
推荐属性:
- description
- sku
- brand
- aggregateRating
- review
json
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Premium Widget",
"image": "https://example.com/widget.jpg",
"description": "Our best-selling widget for professionals",
"sku": "WIDGET-001",
"brand": {
"@type": "Brand",
"name": "Example Co"
},
"offers": {
"@type": "Offer",
"url": "https://example.com/products/widget",
"priceCurrency": "USD",
"price": "99.99",
"availability": "https://schema.org/InStock",
"priceValidUntil": "2024-12-31"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.8",
"reviewCount": "127"
}
}SoftwareApplication
SoftwareApplication(软件应用)
Use for: SaaS product pages, app landing pages
Required properties:
- name
- offers (or free indicator)
Recommended properties:
- applicationCategory
- operatingSystem
- aggregateRating
json
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Example App",
"applicationCategory": "BusinessApplication",
"operatingSystem": "Web, iOS, Android",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.6",
"ratingCount": "1250"
}
}适用场景:SaaS产品页面、应用落地页
必填属性:
- name
- offers(或免费标识)
推荐属性:
- applicationCategory
- operatingSystem
- aggregateRating
json
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Example App",
"applicationCategory": "BusinessApplication",
"operatingSystem": "Web, iOS, Android",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.6",
"ratingCount": "1250"
}
}FAQPage
FAQPage(常见问题页)
Use for: Pages with frequently asked questions
Required properties:
- mainEntity (array of Question/Answer)
json
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is schema markup?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Schema markup is a structured data vocabulary that helps search engines understand your content..."
}
},
{
"@type": "Question",
"name": "How do I implement schema?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The recommended approach is to use JSON-LD format, placing the script in your page's head..."
}
}
]
}适用场景:包含常见问题的页面
必填属性:
- mainEntity(Question/Answer数组)
json
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is schema markup?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Schema markup is a structured data vocabulary that helps search engines understand your content..."
}
},
{
"@type": "Question",
"name": "How do I implement schema?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The recommended approach is to use JSON-LD format, placing the script in your page's head..."
}
}
]
}HowTo
HowTo(教程)
Use for: Instructional content, tutorials
Required properties:
- name
- step (array of HowToStep)
Recommended properties:
- image
- totalTime
- estimatedCost
- supply/tool
json
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "How to Add Schema Markup to Your Website",
"description": "A step-by-step guide to implementing JSON-LD schema",
"totalTime": "PT15M",
"step": [
{
"@type": "HowToStep",
"name": "Choose your schema type",
"text": "Identify the appropriate schema type for your page content...",
"url": "https://example.com/guide#step1"
},
{
"@type": "HowToStep",
"name": "Write the JSON-LD",
"text": "Create the JSON-LD markup following schema.org specifications...",
"url": "https://example.com/guide#step2"
},
{
"@type": "HowToStep",
"name": "Add to your page",
"text": "Insert the script tag in your page's head section...",
"url": "https://example.com/guide#step3"
}
]
}适用场景:教学内容、教程
必填属性:
- name
- step(HowToStep数组)
推荐属性:
- image
- totalTime
- estimatedCost
- supply/tool
json
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "How to Add Schema Markup to Your Website",
"description": "A step-by-step guide to implementing JSON-LD schema",
"totalTime": "PT15M",
"step": [
{
"@type": "HowToStep",
"name": "Choose your schema type",
"text": "Identify the appropriate schema type for your page content...",
"url": "https://example.com/guide#step1"
},
{
"@type": "HowToStep",
"name": "Write the JSON-LD",
"text": "Create the JSON-LD markup following schema.org specifications...",
"url": "https://example.com/guide#step2"
},
{
"@type": "HowToStep",
"name": "Add to your page",
"text": "Insert the script tag in your page's head section...",
"url": "https://example.com/guide#step3"
}
]
}BreadcrumbList
BreadcrumbList(面包屑导航)
Use for: Any page with breadcrumb navigation
json
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Blog",
"item": "https://example.com/blog"
},
{
"@type": "ListItem",
"position": 3,
"name": "SEO Guide",
"item": "https://example.com/blog/seo-guide"
}
]
}适用场景:包含面包屑导航的任意页面
json
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Blog",
"item": "https://example.com/blog"
},
{
"@type": "ListItem",
"position": 3,
"name": "SEO Guide",
"item": "https://example.com/blog/seo-guide"
}
]
}LocalBusiness
LocalBusiness(本地商家)
Use for: Local business location pages
Required properties:
- name
- address
- (Various by business type)
json
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Example Coffee Shop",
"image": "https://example.com/shop.jpg",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main Street",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"addressCountry": "US"
},
"geo": {
"@type": "GeoCoordinates",
"latitude": "37.7749",
"longitude": "-122.4194"
},
"telephone": "+1-555-555-5555",
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"opens": "08:00",
"closes": "18:00"
}
],
"priceRange": "$$"
}适用场景:本地商家位置页面
必填属性:
- name
- address -(根据商家类型有不同要求)
json
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Example Coffee Shop",
"image": "https://example.com/shop.jpg",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main Street",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"addressCountry": "US"
},
"geo": {
"@type": "GeoCoordinates",
"latitude": "37.7749",
"longitude": "-122.4194"
},
"telephone": "+1-555-555-5555",
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"opens": "08:00",
"closes": "18:00"
}
],
"priceRange": "$$"
}Review / AggregateRating
Review / AggregateRating(评价/综合评分)
Use for: Review pages or products with reviews
Note: Self-serving reviews (reviewing your own product) are against guidelines. Reviews must be from real customers.
json
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Example Product",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.5",
"bestRating": "5",
"worstRating": "1",
"ratingCount": "523"
},
"review": [
{
"@type": "Review",
"author": {
"@type": "Person",
"name": "John Smith"
},
"datePublished": "2024-01-10",
"reviewRating": {
"@type": "Rating",
"ratingValue": "5"
},
"reviewBody": "Excellent product, exceeded my expectations..."
}
]
}适用场景:评价页面或带评价的产品页面
注意:自我服务评价(评价自己的产品)违反指南要求。评价必须来自真实客户。
json
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Example Product",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.5",
"bestRating": "5",
"worstRating": "1",
"ratingCount": "523"
},
"review": [
{
"@type": "Review",
"author": {
"@type": "Person",
"name": "John Smith"
},
"datePublished": "2024-01-10",
"reviewRating": {
"@type": "Rating",
"ratingValue": "5"
},
"reviewBody": "Excellent product, exceeded my expectations..."
}
]
}Event
Event(活动)
Use for: Event pages, webinars, conferences
Required properties:
- name
- startDate
- location (or eventAttendanceMode for online)
json
{
"@context": "https://schema.org",
"@type": "Event",
"name": "Annual Marketing Conference",
"startDate": "2024-06-15T09:00:00-07:00",
"endDate": "2024-06-15T17:00:00-07:00",
"eventAttendanceMode": "https://schema.org/OnlineEventAttendanceMode",
"eventStatus": "https://schema.org/EventScheduled",
"location": {
"@type": "VirtualLocation",
"url": "https://example.com/conference"
},
"image": "https://example.com/conference.jpg",
"description": "Join us for our annual marketing conference...",
"offers": {
"@type": "Offer",
"url": "https://example.com/conference/tickets",
"price": "199",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock",
"validFrom": "2024-01-01"
},
"performer": {
"@type": "Organization",
"name": "Example Company"
},
"organizer": {
"@type": "Organization",
"name": "Example Company",
"url": "https://example.com"
}
}适用场景:活动页面、线上研讨会、会议
必填属性:
- name
- startDate
- location(或线上活动的eventAttendanceMode)
json
{
"@context": "https://schema.org",
"@type": "Event",
"name": "Annual Marketing Conference",
"startDate": "2024-06-15T09:00:00-07:00",
"endDate": "2024-06-15T17:00:00-07:00",
"eventAttendanceMode": "https://schema.org/OnlineEventAttendanceMode",
"eventStatus": "https://schema.org/EventScheduled",
"location": {
"@type": "VirtualLocation",
"url": "https://example.com/conference"
},
"image": "https://example.com/conference.jpg",
"description": "Join us for our annual marketing conference...",
"offers": {
"@type": "Offer",
"url": "https://example.com/conference/tickets",
"price": "199",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock",
"validFrom": "2024-01-01"
},
"performer": {
"@type": "Organization",
"name": "Example Company"
},
"organizer": {
"@type": "Organization",
"name": "Example Company",
"url": "https://example.com"
}
}Multiple Schema Types on One Page
单页多Schema类型
You can (and often should) have multiple schema types:
json
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Company",
"url": "https://example.com"
},
{
"@type": "WebSite",
"@id": "https://example.com/#website",
"url": "https://example.com",
"name": "Example",
"publisher": {
"@id": "https://example.com/#organization"
}
},
{
"@type": "BreadcrumbList",
"itemListElement": [...]
}
]
}你可以(且通常应该)在一个页面中使用多种Schema类型:
json
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Company",
"url": "https://example.com"
},
{
"@type": "WebSite",
"@id": "https://example.com/#website",
"url": "https://example.com",
"name": "Example",
"publisher": {
"@id": "https://example.com/#organization"
}
},
{
"@type": "BreadcrumbList",
"itemListElement": [...]
}
]
}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 Rich Results Test:https://search.google.com/test/rich-results
- Schema.org Validator:https://validator.schema.org/
- Search Console:增强功能报告
Common Errors
常见错误
Missing required properties
- Check Google's documentation for required fields
- Different from schema.org minimum requirements
Invalid values
- Dates must be ISO 8601 format
- URLs must be fully qualified
- Enumerations must use exact values
Mismatch with page content
- Schema doesn't match visible content
- Ratings for products without reviews shown
- Prices that don't match displayed prices
缺少必填属性
- 查看Google文档中的必填字段
- 与schema.org的最低要求不同
无效值
- 日期必须为ISO 8601格式
- URL必须是完整链接
- 枚举值必须使用精确值
与页面内容不匹配
- Schema与可见内容不一致
- 产品无展示评价却添加评分
- 价格与显示价格不符
Implementation Patterns
实现模式
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, etc.)
动态站点(React、Next.js等)
- Component that renders schema
- Server-side rendered for SEO
- Serialize data to JSON-LD
jsx
// Next.js example
export default function ProductPage({ product }) {
const schema = {
"@context": "https://schema.org",
"@type": "Product",
name: product.name,
// ... other properties
};
return (
<>
<Head>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
/>
</Head>
{/* Page content */}
</>
);
}- 渲染schema的组件
- 服务端渲染以优化SEO
- 将数据序列化为JSON-LD
jsx
// Next.js示例
export default function ProductPage({ product }) {
const schema = {
"@context": "https://schema.org",
"@type": "Product",
name: product.name,
// ... 其他属性
};
return (
<>
<Head>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
/>
</Head>
{/* 页面内容 */}
</>
);
}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": "...",
// 完整标记
}Placement Instructions
放置说明
Where to add the code and how
代码添加位置及方式
Testing Checklist
测试清单
- Validates in Rich Results Test
- No errors or warnings
- Matches page content
- All required properties included
- 通过Rich Results Test验证
- 无错误或警告
- 与页面内容匹配
- 包含所有必填属性
Questions to Ask
待确认问题
If you need more context:
- 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 for implementation?
如需更多上下文,请确认:
- 这是什么类型的页面?
- 你希望实现哪些富结果?
- 有哪些可用于填充schema的数据?
- 页面上是否已有现有schema?
- 你使用的技术栈是什么?
Related Skills
相关技能
- review-seo-audit: For overall SEO including schema review
- tool-programmatic-seo: For templated schema at scale
- analytics-tracking: For measuring rich result impact
- review-seo-audit:包含schema审核的整体SEO评估
- tool-programmatic-seo:大规模模板化schema
- analytics-tracking:衡量富结果影响