Blog Schema -- JSON-LD 結構化資料產生器
為部落格文章產生完整且經過驗證的 JSON-LD 結構化資料,採用 @graph 模式。結合多種綱要類型於單一 script 標籤中,並使用穩定的 @id 參考進行實體連結。
工作流程
步驟 1:讀取內容
讀取部落格文章並提取所有與結構化資料相關的資料:
- 標題 (headline)
- 作者 (姓名、職稱、社群連結、證照)
- 日期 (datePublished, dateModified / lastUpdated)
- 描述 (meta description)
- 常見問題區塊 (問題與答案配對)
- 圖片 (封面圖片網址、尺寸、替代文字;內嵌圖片)
- 組織資訊 (網站名稱、網址、標誌)
- 字數 (根據內容長度估算)
- 標籤/分類 (用於 BreadcrumbList 分類)
- Slug (從檔案名稱或 frontmatter 取得)
步驟 2:產生 BlogPosting 綱要
包含所有必要與建議屬性的完整 BlogPosting:
{
"@type": "BlogPosting",
"@id": "{siteUrl}/blog/{slug}#article",
"headline": "文章標題 (最多 110 個字元)",
"description": "Meta 描述 (150-160 個字元)",
"datePublished": "YYYY-MM-DD",
"dateModified": "YYYY-MM-DD",
"author": { "@id": "{siteUrl}/author/{author-slug}#person" },
"publisher": { "@id": "{siteUrl}#organization" },
"image": { "@id": "{siteUrl}/blog/{slug}#primaryimage" },
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{siteUrl}/blog/{slug}"
},
"wordCount": 2400,
"articleBody": "內容的前 200 個字元作為摘要..."
}
必要屬性:@type, headline, datePublished, author, publisher, image。 建議屬性:description, dateModified, mainEntityOfPage, wordCount, articleBody(摘要)。
步驟 3:產生 Person 綱要
作者綱要,使用穩定的 @id 以便交叉引用:
{
"@type": "Person",
"@id": "{siteUrl}/author/{author-slug}#person",
"name": "作者姓名",
"jobTitle": "角色或頭銜",
"url": "{siteUrl}/author/{author-slug}",
"sameAs": [
"https://twitter.com/handle",
"https://linkedin.com/in/handle",
"https://github.com/handle"
]
}
可選屬性(如有則包含):
alumniOf- 畢業學校 (Organization 類型)worksFor- 雇主 (若為同一實體,可參考 Organization 的 @id)
步驟 4:產生 Organization 綱要
部落格所屬的組織實體:
{
"@type": "Organization",
"@id": "{siteUrl}#organization",
"name": "組織名稱",
"url": "{siteUrl}",
"logo": {
"@type": "ImageObject",
"url": "{siteUrl}/logo.png",
"width": 600,
"height": 60
},
"sameAs": [
"https://twitter.com/org",
"https://linkedin.com/company/org",
"https://github.com/org"
]
}
標誌要求:必須是有效的圖片網址。Google 建議標誌最小 112x112 像素,最大寬度 600 像素。BlogPosting 發布者偏好使用矩形標誌。
步驟 5:產生 BreadcrumbList
導覽麵包屑綱要,顯示內容層級:
{
"@type": "BreadcrumbList",
"@id": "{siteUrl}/blog/{slug}#breadcrumb",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "首頁",
"item": "{siteUrl}"
},
{
"@type": "ListItem",
"position": 2,
"name": "分類名稱",
"item": "{siteUrl}/blog/category/{category-slug}"
},
{
"@type": "ListItem",
"position": 3,
"name": "文章標題",
"item": "{siteUrl}/blog/{slug}"
}
]
}
如果沒有分類,則使用「部落格」作為第二個麵包屑項目,網址為 {siteUrl}/blog。
步驟 6:產生 FAQPage 綱要
從部落格文章的常見問題區塊提取問答配對:
{
"@type": "FAQPage",
"@id": "{siteUrl}/blog/{slug}#faq",
"mainEntity": [
{
"@type": "Question",
"name": "問題是什麼?",
"acceptedAnswer": {
"@type": "Answer",
"text": "完整的答案文字 (40-60 字,包含統計數據)。"
}
}
]
}
重要提示:自 2023 年 8 月起,Google 將 FAQ 豐富結果限制為僅適用於政府與健康網站。然而,FAQ 結構化資料仍具有價值,因為:
- AI 系統 (ChatGPT、Perplexity、Gemini) 會提取 FAQ 資料作為引用
- 它為未來豐富結果資格變更做好結構準備
- 它改善內容組織訊號
步驟 7:產生 VideoObject(如有影片)
針對文章中嵌入的每個 YouTube 影片,產生 VideoObject 綱要:
{
"@type": "VideoObject",
"@id": "{siteUrl}/blog/{slug}#video-{index}",
"name": "影片標題",
"description": "影片描述摘要 (前 200 個字元)",
"thumbnailUrl": "https://img.youtube.com/vi/{videoId}/hqdefault.jpg",
"uploadDate": "{ISO 8601 date}",
"contentUrl": "https://www.youtube.com/watch?v={videoId}",
"embedUrl": "https://www.youtube.com/embed/{videoId}",
"duration": "PT{M}M{S}S",
"interactionStatistic": {
"@type": "InteractionCounter",
"interactionType": { "@type": "WatchAction" },
"userInteractionCount": {viewCount}
}
}
將每個 VideoObject 加入 @graph 陣列中。使用 #video-1、#video-2 等作為 @id 片段。從嵌入的 noscript 備用內容或透過 blog-google 從 YouTube Data API 提取影片後設資料。
步驟 7.5:產生 ImageObject
文章主要圖片的封面圖片綱要:
{
"@type": "ImageObject",
"@id": "{siteUrl}/blog/{slug}#primaryimage",
"url": "https://cdn.pixabay.com/photo/.../image.jpg",
"width": 1200,
"height": 630,
"caption": "與替代文字相符的描述性標題"
}
圖片要求:
- URL 必須可爬取且可公開存取
- 寬度與高度應反映實際圖片尺寸
- 標題應與圖片替代文字相符或緊密對齊
- 建議尺寸:1200x630 (與 OG 相容) 或 1920x1080
步驟 8:驗證與警告
檢查已棄用的綱要類型並套用驗證規則:
絕不要使用以下已棄用的類型:
- HowTo - 2023 年 9 月已棄用(Google 不再顯示豐富結果)
- SpecialAnnouncement - 2025 年 7 月已棄用
- Practice Problem - 已棄用(教育標記)
- Dataset - 已棄用(不建議用於一般用途)
- Sitelinks Search Box - 已棄用
- Q&A - 2026 年 1 月已棄用(與 FAQPage 不同)
驗證檢查:
- 所有 @id 參考皆解析至 @graph 中的實體
- dateModified 等於或晚於 datePublished
- headline 不超過 110 個字元
- description 介於 50-160 個字元之間
- 所有 URL 皆為絕對路徑(非相對路徑)
- 圖片尺寸為正整數
- BreadcrumbList 的 position 從 1 開始依序編號
- FAQPage 至少包含 2 個問題
**AI 引用最佳化提示:**使用 3 種以上綱要類型的頁面,AI 引用機率約提高 13%。此技能最多可產生 7 種類型 (BlogPosting、Person、Organization、BreadcrumbList、FAQPage、ImageObject、VideoObject),以最大化搜尋引擎理解與 AI 提取效益。
步驟 9:輸出
將所有綱要透過 @graph 模式結合到單一 <script> 標籤中:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{ "@type": "BlogPosting", ... },
{ "@type": "Person", ... },
{ "@type": "Organization", ... },
{ "@type": "BreadcrumbList", ... },
{ "@type": "FAQPage", ... },
{ "@type": "VideoObject", ... },
{ "@type": "ImageObject", ... }
]
}
</script>
@graph 模式優點:
- 單一 script 標籤而非多個 - HTML 更乾淨
- 透過穩定的 @id 參考進行實體連結(例如,author 透過 @id 參考 Person)
- Google 與 AI 系統能正確解析 @graph 陣列
- 更容易以單一區塊維護與更新
輸出選項:
- Embedded HTML - 可直接貼入
<head>或</body>之前 - Standalone JSON - 用於 CMS 結構化資料欄位或 API 注入
- MDX component - 若專案使用 MDX,則包裝成元件
依使用者偏好,將產生的結構化資料儲存至部落格文章檔案或獨立的結構化資料檔案。