加载课程详情中...
加载课程详情中...
使用 Schema 标记获得富媒体搜索结果
搜索引擎虽然聪明,但有时候也需要一点"小抄"。 结构化数据 (Structured Data),也就是常说的 Schema Markup,就是这张小抄。 它用一种搜索引擎能秒懂的 JSON 格式,明确告诉它: "这不仅是一段文字,这是一个食谱,耗时 30 分钟,有 500 卡路里,评分为 4.8。"
做了结构化数据,你能在搜索结果页 (SERP) 获得极其显眼的展示样式。这会直接导致点击率 (CTR) 暴涨 30% 以上。
Google 官方唯一推荐的格式是 JSON-LD。它是一段放在 <script> 标签里的 JavaScript 对象,通常放在 <head> 或 <body> 中。
每个页面都应该有的基础配置。
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "SEO 基础教程:从入门到精通",
"image": [
"https://example.com/images/seo-cover.jpg"
],
"datePublished": "2025-01-18T08:00:00+08:00",
"dateModified": "2025-01-19T09:20:00+08:00",
"author": [{
"@type": "Person",
"name": "Alex",
"url": "https://example.com/author/alex"
}]
}
</script>
让用户在搜产品时直接看到"¥99"和"⭐⭐⭐⭐⭐"。
{
"@context": "https://schema.org/",
"@type": "Product",
"name": "超轻机械键盘",
"image": "https://example.com/keyboard.jpg",
"description": "适合程序员的静音红轴键盘...",
"brand": {
"@type": "Brand",
"name": "KeyChron"
},
"offers": {
"@type": "Offer",
"url": "https://example.com/product/keyboard",
"priceCurrency": "CNY",
"price": "499",
"availability": "https://schema.org/InStock"
}
}
如果你有一篇"如何做 xxx"的文章,加上 FAQ Schema,Google 可能会直接把你的问答展示在搜索结果里,占据大片版面。
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [{
"@type": "Question",
"name": "SEO 需要多久见效?",
"acceptedAnswer": {
"@type": "Answer",
"text": "通常需要 3-6 个月才能看到明显的自然流量增长..."
}
}]
}
如果你用 Next.js,不要手动写字符串。建议使用社区验证过的库 next-seo 或直接在 layout.tsx / page.tsx 中注入。
script 组件 (App Router)import Script from 'next/script'
export default function Page({ params }) {
const jsonLd = {
'@context': 'https://schema.org',
'@type': 'Product',
name: 'Product Name',
image: 'https://example.com/image.jpg',
description: 'Product description',
}
return (
<section>
{/* 注入 JSON-LD */}
<Script
id="product-schema"
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(jsonLd),
}}
/>
{/* 页面内容 */}
</section>
)
}
写完代码,一定要验证!语法哪怕错一个逗号,Google 都会直接忽略。
结构化数据是 SEO 中投入产出比极高的一项工作。 你不需要改动页面 UI,只需要加一段代码,就能让你的搜索结果变得"高大上",点击率翻倍。 现在就去检查你的产品页和文章页,加上 JSON-LD 吧!
至此,第四章"技术 SEO"结束。接下来我们将进入 SEO 最难但也最核心的部分:外链建设。
觉得这节课有帮助?
出海了吗
chuhailema.com
AI出海 · 技术分享 · 实战经验
扫码阅读全文
获取更多出海干货