schema-markup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSchema Markup Generator Skill
Schema标记生成Skill
You are an expert in Schema.org structured data and Google's rich results requirements. Generate valid, complete JSON-LD markup that maximizes eligibility for Google rich results.
你是Schema.org结构化数据和谷歌富搜索结果要求方面的专家。请生成符合要求的完整JSON-LD标记,以最大程度满足谷歌富搜索结果的准入条件。
Supported Schema Types
支持的Schema类型
This skill supports the following schema types. When the user asks for schema, determine which type(s) are appropriate based on the page content.
本Skill支持以下Schema类型。当用户请求生成schema时,请根据页面内容判断适用的类型。
1. Article / BlogPosting / NewsArticle
1. Article / BlogPosting / NewsArticle
Use for: Blog posts, news articles, editorial content
Rich result: Article carousel, headline in search
json
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Your Article Title (max 110 characters)",
"description": "Brief description of the article (max 160 characters)",
"image": [
"https://example.com/image-16x9.jpg",
"https://example.com/image-4x3.jpg",
"https://example.com/image-1x1.jpg"
],
"datePublished": "2025-01-15T08:00:00+00:00",
"dateModified": "2025-01-20T10:30:00+00:00",
"author": [{
"@type": "Person",
"name": "Author Name",
"url": "https://example.com/author/name",
"jobTitle": "Senior Editor",
"sameAs": [
"https://twitter.com/authorhandle",
"https://linkedin.com/in/authorname"
]
}],
"publisher": {
"@type": "Organization",
"name": "Publisher Name",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png",
"width": 600,
"height": 60
}
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.com/article-url"
},
"wordCount": 2500,
"articleSection": "Technology",
"keywords": ["keyword1", "keyword2", "keyword3"],
"isAccessibleForFree": true
}Google requirements:
- is required (max 110 characters)
headline - is required (provide 3 aspect ratios: 16:9, 4:3, 1:1; each > 696px wide)
image - is required (ISO 8601 format)
datePublished - is required
author.name - For , also add
NewsArticleif applicabledateline - For ,
BlogPostingchanges to@type"BlogPosting"
适用场景: 博客文章、新闻报道、编辑类内容
富搜索结果: 文章轮播、搜索结果标题
json
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Your Article Title (max 110 characters)",
"description": "Brief description of the article (max 160 characters)",
"image": [
"https://example.com/image-16x9.jpg",
"https://example.com/image-4x3.jpg",
"https://example.com/image-1x1.jpg"
],
"datePublished": "2025-01-15T08:00:00+00:00",
"dateModified": "2025-01-20T10:30:00+00:00",
"author": [{
"@type": "Person",
"name": "Author Name",
"url": "https://example.com/author/name",
"jobTitle": "Senior Editor",
"sameAs": [
"https://twitter.com/authorhandle",
"https://linkedin.com/in/authorname"
]
}],
"publisher": {
"@type": "Organization",
"name": "Publisher Name",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png",
"width": 600,
"height": 60
}
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.com/article-url"
},
"wordCount": 2500,
"articleSection": "Technology",
"keywords": ["keyword1", "keyword2", "keyword3"],
"isAccessibleForFree": true
}谷歌要求:
- 为必填项(最多110个字符)
headline - 为必填项(需提供3种宽高比:16:9、4:3、1:1;每张图片宽度需大于696px)
image - 为必填项(采用ISO 8601格式)
datePublished - 为必填项
author.name - 若为,适用时需添加
NewsArticle字段dateline - 若为,需将
BlogPosting改为@type"BlogPosting"
2. Product
2. Product
Use for: Product pages, e-commerce listings
Rich result: Product snippet with price, availability, reviews
json
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Product Name",
"description": "Product description",
"image": [
"https://example.com/product-1.jpg",
"https://example.com/product-2.jpg"
],
"sku": "SKU-12345",
"mpn": "MPN-67890",
"gtin13": "0123456789012",
"brand": {
"@type": "Brand",
"name": "Brand Name"
},
"offers": {
"@type": "Offer",
"url": "https://example.com/product",
"priceCurrency": "USD",
"price": "99.99",
"priceValidUntil": "2025-12-31",
"availability": "https://schema.org/InStock",
"itemCondition": "https://schema.org/NewCondition",
"seller": {
"@type": "Organization",
"name": "Seller Name"
},
"shippingDetails": {
"@type": "OfferShippingDetails",
"shippingRate": {
"@type": "MonetaryAmount",
"value": "0",
"currency": "USD"
},
"deliveryTime": {
"@type": "ShippingDeliveryTime",
"handlingTime": {
"@type": "QuantitativeValue",
"minValue": 0,
"maxValue": 1,
"unitCode": "DAY"
},
"transitTime": {
"@type": "QuantitativeValue",
"minValue": 1,
"maxValue": 5,
"unitCode": "DAY"
}
},
"shippingDestination": {
"@type": "DefinedRegion",
"addressCountry": "US"
}
},
"hasMerchantReturnPolicy": {
"@type": "MerchantReturnPolicy",
"applicableCountry": "US",
"returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow",
"merchantReturnDays": 30,
"returnMethod": "https://schema.org/ReturnByMail",
"returnFees": "https://schema.org/FreeReturn"
}
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.5",
"bestRating": "5",
"ratingCount": "142"
},
"review": [{
"@type": "Review",
"author": {
"@type": "Person",
"name": "Reviewer Name"
},
"datePublished": "2025-01-10",
"reviewBody": "Review text here",
"reviewRating": {
"@type": "Rating",
"ratingValue": "5",
"bestRating": "5"
}
}]
}Google requirements:
- is required
name - ,
offers, orreview- at least one requiredaggregateRating - and
offers.pricerequired if offers presentoffers.priceCurrency - must use Schema.org enum values
offers.availability - As of 2024, and
shippingDetailsare recommended for merchant listingshasMerchantReturnPolicy
适用场景: 产品页面、电商商品列表
富搜索结果: 包含价格、库存状态、评论的产品摘要
json
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Product Name",
"description": "Product description",
"image": [
"https://example.com/product-1.jpg",
"https://example.com/product-2.jpg"
],
"sku": "SKU-12345",
"mpn": "MPN-67890",
"gtin13": "0123456789012",
"brand": {
"@type": "Brand",
"name": "Brand Name"
},
"offers": {
"@type": "Offer",
"url": "https://example.com/product",
"priceCurrency": "USD",
"price": "99.99",
"priceValidUntil": "2025-12-31",
"availability": "https://schema.org/InStock",
"itemCondition": "https://schema.org/NewCondition",
"seller": {
"@type": "Organization",
"name": "Seller Name"
},
"shippingDetails": {
"@type": "OfferShippingDetails",
"shippingRate": {
"@type": "MonetaryAmount",
"value": "0",
"currency": "USD"
},
"deliveryTime": {
"@type": "ShippingDeliveryTime",
"handlingTime": {
"@type": "QuantitativeValue",
"minValue": 0,
"maxValue": 1,
"unitCode": "DAY"
},
"transitTime": {
"@type": "QuantitativeValue",
"minValue": 1,
"maxValue": 5,
"unitCode": "DAY"
}
},
"shippingDestination": {
"@type": "DefinedRegion",
"addressCountry": "US"
}
},
"hasMerchantReturnPolicy": {
"@type": "MerchantReturnPolicy",
"applicableCountry": "US",
"returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow",
"merchantReturnDays": 30,
"returnMethod": "https://schema.org/ReturnByMail",
"returnFees": "https://schema.org/FreeReturn"
}
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.5",
"bestRating": "5",
"ratingCount": "142"
},
"review": [{
"@type": "Review",
"author": {
"@type": "Person",
"name": "Reviewer Name"
},
"datePublished": "2025-01-10",
"reviewBody": "Review text here",
"reviewRating": {
"@type": "Rating",
"ratingValue": "5",
"bestRating": "5"
}
}]
}谷歌要求:
- 为必填项
name - 需至少提供、
offers或review中的一项aggregateRating - 若包含,则
offers和offers.price为必填项offers.priceCurrency - 必须使用Schema.org枚举值
offers.availability - 截至2024年,商家列表推荐添加和
shippingDetails字段hasMerchantReturnPolicy
3. FAQPage
3. FAQPage
Use for: FAQ sections, Q&A pages
Rich result: Expandable FAQ in search results
json
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is the first question?",
"acceptedAnswer": {
"@type": "Answer",
"text": "<p>The answer with <strong>HTML formatting</strong> allowed. You can include <a href=\"https://example.com\">links</a>.</p>"
}
},
{
"@type": "Question",
"name": "What is the second question?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Plain text answers also work."
}
}
]
}Google requirements:
- Each must have exactly one
QuestionacceptedAnswer - Answer can include HTML:
textthrough<h2>,<h6>,<br>,<ol>,<ul>,<li>,<a>,<p>,<b>,<strong>,<i><em> - Must be visible on the page (not hidden behind tabs/accordions without proper implementation)
- Google may show up to 3 FAQ rich results per page
- Do not use for advertising purposes
适用场景: FAQ板块、问答页面
富搜索结果: 搜索结果中的可展开FAQ
json
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is the first question?",
"acceptedAnswer": {
"@type": "Answer",
"text": "<p>The answer with <strong>HTML formatting</strong> allowed. You can include <a href=\"https://example.com\">links</a>.</p>"
}
},
{
"@type": "Question",
"name": "What is the second question?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Plain text answers also work."
}
}
]
}谷歌要求:
- 每个必须对应且仅对应一个
QuestionacceptedAnswer - 答案可包含HTML标签:
text至<h2>、<h6>、<br>、<ol>、<ul>、<li>、<a>、<p>、<b>、<strong>、<i><em> - 内容必须在页面上可见(若放在标签页/折叠面板后,需确保实现方式合规)
- 谷歌每页最多展示3个FAQ富搜索结果
- 不得用于广告用途
4. HowTo
4. HowTo
Use for: Tutorial pages, step-by-step guides, DIY instructions
Rich result: Step-by-step display in search results
json
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "How to Do Something",
"description": "Brief description of the task",
"image": {
"@type": "ImageObject",
"url": "https://example.com/howto-main.jpg",
"height": "406",
"width": "305"
},
"totalTime": "PT30M",
"estimatedCost": {
"@type": "MonetaryAmount",
"currency": "USD",
"value": "20"
},
"supply": [
{
"@type": "HowToSupply",
"name": "Supply item 1"
},
{
"@type": "HowToSupply",
"name": "Supply item 2"
}
],
"tool": [
{
"@type": "HowToTool",
"name": "Tool 1"
}
],
"step": [
{
"@type": "HowToStep",
"name": "Step 1 Title",
"text": "Detailed instructions for step 1.",
"url": "https://example.com/howto#step1",
"image": "https://example.com/step1.jpg"
},
{
"@type": "HowToStep",
"name": "Step 2 Title",
"text": "Detailed instructions for step 2.",
"url": "https://example.com/howto#step2",
"image": "https://example.com/step2.jpg"
}
]
}Google requirements:
- is required
name - array is required with at least one step
step - Each step needs either or
textwithitemListElement/HowToDirectionHowToTip - uses ISO 8601 duration format (PT1H30M = 1 hour 30 minutes)
totalTime - Do not use HowTo for recipes (use Recipe schema instead)
适用场景: 教程页面、分步指南、DIY说明
富搜索结果: 搜索结果中的分步展示
json
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "How to Do Something",
"description": "Brief description of the task",
"image": {
"@type": "ImageObject",
"url": "https://example.com/howto-main.jpg",
"height": "406",
"width": "305"
},
"totalTime": "PT30M",
"estimatedCost": {
"@type": "MonetaryAmount",
"currency": "USD",
"value": "20"
},
"supply": [
{
"@type": "HowToSupply",
"name": "Supply item 1"
},
{
"@type": "HowToSupply",
"name": "Supply item 2"
}
],
"tool": [
{
"@type": "HowToTool",
"name": "Tool 1"
}
],
"step": [
{
"@type": "HowToStep",
"name": "Step 1 Title",
"text": "Detailed instructions for step 1.",
"url": "https://example.com/howto#step1",
"image": "https://example.com/step1.jpg"
},
{
"@type": "HowToStep",
"name": "Step 2 Title",
"text": "Detailed instructions for step 2.",
"url": "https://example.com/howto#step2",
"image": "https://example.com/step2.jpg"
}
]
}谷歌要求:
- 为必填项
name - 数组为必填项,且至少包含一个步骤
step - 每个步骤需包含或带有
text/HowToDirection的HowToTipitemListElement - 采用ISO 8601时长格式(PT1H30M = 1小时30分钟)
totalTime - 食谱类内容请勿使用HowTo类型(请使用Recipe schema)
5. Organization
5. Organization
Use for: Homepage, about page, company information
Rich result: Knowledge panel, logo in search
json
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Company Name",
"alternateName": "Company Abbreviation",
"url": "https://example.com",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png",
"width": 512,
"height": 512
},
"description": "Company description",
"foundingDate": "2020-01-01",
"founder": {
"@type": "Person",
"name": "Founder Name"
},
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main St",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"addressCountry": "US"
},
"contactPoint": [{
"@type": "ContactPoint",
"telephone": "+1-555-555-5555",
"contactType": "customer service",
"areaServed": "US",
"availableLanguage": "English"
}],
"sameAs": [
"https://twitter.com/company",
"https://linkedin.com/company/company",
"https://facebook.com/company",
"https://github.com/company"
],
"numberOfEmployees": {
"@type": "QuantitativeValue",
"minValue": 10,
"maxValue": 50
}
}适用场景: 首页、关于我们页面、企业信息页
富搜索结果: 知识面板、搜索结果中的logo
json
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Company Name",
"alternateName": "Company Abbreviation",
"url": "https://example.com",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png",
"width": 512,
"height": 512
},
"description": "Company description",
"foundingDate": "2020-01-01",
"founder": {
"@type": "Person",
"name": "Founder Name"
},
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main St",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"addressCountry": "US"
},
"contactPoint": [{
"@type": "ContactPoint",
"telephone": "+1-555-555-5555",
"contactType": "customer service",
"areaServed": "US",
"availableLanguage": "English"
}],
"sameAs": [
"https://twitter.com/company",
"https://linkedin.com/company/company",
"https://facebook.com/company",
"https://github.com/company"
],
"numberOfEmployees": {
"@type": "QuantitativeValue",
"minValue": 10,
"maxValue": 50
}
}6. LocalBusiness
6. LocalBusiness
Use for: Local business pages, Google Business Profile support
Rich result: Local business panel, map results
json
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"@id": "https://example.com/#business",
"name": "Business Name",
"description": "Business description",
"url": "https://example.com",
"telephone": "+1-555-555-5555",
"email": "info@example.com",
"image": "https://example.com/storefront.jpg",
"logo": "https://example.com/logo.png",
"priceRange": "$$",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main St",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"addressCountry": "US"
},
"geo": {
"@type": "GeoCoordinates",
"latitude": "37.7749",
"longitude": "-122.4194"
},
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"opens": "09:00",
"closes": "17:00"
},
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": "Saturday",
"opens": "10:00",
"closes": "14:00"
}
],
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.7",
"bestRating": "5",
"ratingCount": "312"
},
"areaServed": {
"@type": "City",
"name": "San Francisco"
},
"hasMap": "https://maps.google.com/?cid=123456789"
}Google requirements:
- ,
nameare requiredaddress - Use specific subtypes when possible: ,
Restaurant,Dentist,LegalService, etc.RealEstateAgent - coordinates should be accurate to the business location
geo - must reflect actual business hours
openingHoursSpecification
适用场景: 本地商家页面、谷歌商家资料支持
富搜索结果: 本地商家面板、地图搜索结果
json
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"@id": "https://example.com/#business",
"name": "Business Name",
"description": "Business description",
"url": "https://example.com",
"telephone": "+1-555-555-5555",
"email": "info@example.com",
"image": "https://example.com/storefront.jpg",
"logo": "https://example.com/logo.png",
"priceRange": "$$",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main St",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"addressCountry": "US"
},
"geo": {
"@type": "GeoCoordinates",
"latitude": "37.7749",
"longitude": "-122.4194"
},
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"opens": "09:00",
"closes": "17:00"
},
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": "Saturday",
"opens": "10:00",
"closes": "14:00"
}
],
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.7",
"bestRating": "5",
"ratingCount": "312"
},
"areaServed": {
"@type": "City",
"name": "San Francisco"
},
"hasMap": "https://maps.google.com/?cid=123456789"
}谷歌要求:
- 、
name为必填项address - 尽可能使用具体的子类型:、
Restaurant、Dentist、LegalService等RealEstateAgent - 坐标需与商家实际位置一致
geo - 必须准确反映商家实际营业时间
openingHoursSpecification
7. BreadcrumbList
7. BreadcrumbList
Use for: Any page with breadcrumb navigation
Rich result: Breadcrumb trail in search results
json
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Category",
"item": "https://example.com/category"
},
{
"@type": "ListItem",
"position": 3,
"name": "Current Page Title"
}
]
}Google requirements:
- must be sequential starting at 1
position - Last item should not have (it's the current page)
item - Must match the visible breadcrumb on the page
适用场景: 带有面包屑导航的任意页面
富搜索结果: 搜索结果中的面包屑路径
json
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Category",
"item": "https://example.com/category"
},
{
"@type": "ListItem",
"position": 3,
"name": "Current Page Title"
}
]
}谷歌要求:
- 必须从1开始按顺序排列
position - 最后一项不应包含字段(代表当前页面)
item - 必须与页面上可见的面包屑导航一致
8. Review / AggregateRating
8. Review / AggregateRating
Use for: Review pages, product reviews, service reviews
Rich result: Star rating in search results
json
{
"@context": "https://schema.org",
"@type": "Review",
"name": "Review Title",
"reviewBody": "Full review text...",
"datePublished": "2025-01-15",
"author": {
"@type": "Person",
"name": "Reviewer Name"
},
"itemReviewed": {
"@type": "Product",
"name": "Product Being Reviewed",
"image": "https://example.com/product.jpg"
},
"reviewRating": {
"@type": "Rating",
"ratingValue": "4",
"bestRating": "5",
"worstRating": "1"
},
"publisher": {
"@type": "Organization",
"name": "Review Site Name"
}
}Google requirements:
- is required (must be a valid
authororPerson)Organization - is required
itemReviewed - is recommended
reviewRating - Self-serving reviews (reviewing your own product) are against guidelines
适用场景: 评论页面、产品评论、服务评价
富搜索结果: 搜索结果中的星级评分
json
{
"@context": "https://schema.org",
"@type": "Review",
"name": "Review Title",
"reviewBody": "Full review text...",
"datePublished": "2025-01-15",
"author": {
"@type": "Person",
"name": "Reviewer Name"
},
"itemReviewed": {
"@type": "Product",
"name": "Product Being Reviewed",
"image": "https://example.com/product.jpg"
},
"reviewRating": {
"@type": "Rating",
"ratingValue": "4",
"bestRating": "5",
"worstRating": "1"
},
"publisher": {
"@type": "Organization",
"name": "Review Site Name"
}
}谷歌要求:
- 为必填项(必须是有效的
author或Person类型)Organization - 为必填项
itemReviewed - 推荐添加字段
reviewRating - 自我宣传性质的评论(如评价自家产品)违反谷歌指南
Multi-Schema Pages
多Schema页面
Most pages need multiple schema types. Combine them using :
@graphjson
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Company Name",
"url": "https://example.com",
"logo": "https://example.com/logo.png"
},
{
"@type": "WebSite",
"@id": "https://example.com/#website",
"url": "https://example.com",
"name": "Site Name",
"publisher": { "@id": "https://example.com/#organization" }
},
{
"@type": "WebPage",
"@id": "https://example.com/page/#webpage",
"url": "https://example.com/page/",
"name": "Page Title",
"isPartOf": { "@id": "https://example.com/#website" }
},
{
"@type": "Article",
"mainEntityOfPage": { "@id": "https://example.com/page/#webpage" },
"headline": "Article Title",
"author": { "@type": "Person", "name": "Author" },
"publisher": { "@id": "https://example.com/#organization" },
"datePublished": "2025-01-15"
},
{
"@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": "Article Title" }
]
}
]
}大多数页面需要同时使用多种Schema类型。可通过字段将它们组合:
@graphjson
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Company Name",
"url": "https://example.com",
"logo": "https://example.com/logo.png"
},
{
"@type": "WebSite",
"@id": "https://example.com/#website",
"url": "https://example.com",
"name": "Site Name",
"publisher": { "@id": "https://example.com/#organization" }
},
{
"@type": "WebPage",
"@id": "https://example.com/page/#webpage",
"url": "https://example.com/page/",
"name": "Page Title",
"isPartOf": { "@id": "https://example.com/#website" }
},
{
"@type": "Article",
"mainEntityOfPage": { "@id": "https://example.com/page/#webpage" },
"headline": "Article Title",
"author": { "@type": "Person", "name": "Author" },
"publisher": { "@id": "https://example.com/#organization" },
"datePublished": "2025-01-15"
},
{
"@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": "Article Title" }
]
}
]
}Generation Process
生成流程
When the user asks for schema markup:
- Determine page type - Ask what kind of page this is for (or infer from context)
- Gather information - Ask for or collect the required fields. If the user provides a URL, fetch it to extract data.
- Select schema types - Choose all applicable schemas (most pages need 2-4 types)
- Generate JSON-LD - Create complete, valid markup
- Validate - Check against Google's requirements for each type
- Provide implementation instructions - Tell the user exactly where to place it
当用户请求生成schema标记时,请遵循以下步骤:
- 确定页面类型 - 询问用户该标记用于哪种页面(或根据上下文推断)
- 收集信息 - 询问或收集必填字段的信息。若用户提供URL,可抓取页面内容提取数据。
- 选择Schema类型 - 选择所有适用的Schema类型(大多数页面需要2-4种)
- 生成JSON-LD - 创建完整、符合要求的标记
- 验证 - 对照每种类型的谷歌要求进行检查
- 提供实现说明 - 明确告知用户标记的放置位置
Implementation Instructions
实现说明
—
Next.js App Router
For Next.js App Router:
tsx
// In your page component or layout
export default function Page() {
const jsonLd = {/* generated schema */};
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
{/* page content */}
</>
);
}For Next.js with next/head (Pages Router):
tsx
import Head from 'next/head';
export default function Page() {
const jsonLd = {/* generated schema */};
return (
<>
<Head>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
</Head>
{/* page content */}
</>
);
}For plain HTML:
html
<head>
<script type="application/ld+json">
{/* generated schema */}
</script>
</head>tsx
// 在页面组件或布局文件中
export default function Page() {
const jsonLd = {/* generated schema */};
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
{/* 页面内容 */}
</>
);
}Validation
Next.js with next/head(Pages Router)
After generating the markup, remind the user to validate using:
- Google Rich Results Test: https://search.google.com/test/rich-results
- Schema.org Validator: https://validator.schema.org/
tsx
import Head from 'next/head';
export default function Page() {
const jsonLd = {/* generated schema */};
return (
<>
<Head>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
</Head>
{/* 页面内容 */}
</>
);
}Common Mistakes to Avoid
纯HTML页面
- Do not add schema for content that is not visible on the page
- Do not use schema for self-serving reviews of your own business
Review - Do not markup content behind a paywall as
isAccessibleForFree: true - Do not use fake or placeholder data in production schema
- Do not add without actual user reviews
AggregateRating - Always use absolute URLs, never relative
- Always use ISO 8601 date format
- must be a future date
priceValidUntil - must use full Schema.org URL (e.g.,
availability)https://schema.org/InStock - Image URLs must be crawlable and indexable
html
<head>
<script type="application/ld+json">
{/* generated schema */}
</script>
</head>—
验证
—
生成标记后,请提醒用户通过以下工具进行验证:
- 谷歌富搜索结果测试工具: https://search.google.com/test/rich-results
- Schema.org验证工具: https://validator.schema.org/
—
需避免的常见错误
—
- 请勿为页面上不可见的内容添加schema标记
- 请勿为自家产品/服务的自评使用schema
Review - 请勿将付费墙后的内容标记为
isAccessibleForFree: true - 生产环境的schema标记请勿使用虚假或占位数据
- 若无真实用户评论,请勿添加字段
AggregateRating - 始终使用绝对URL,切勿使用相对URL
- 日期格式请始终采用ISO 8601标准
- 必须设置为未来日期
priceValidUntil - 必须使用完整的Schema.org URL(例如:
availability)https://schema.org/InStock - 图片URL必须可被爬虫抓取和索引