链接发到微信里没有缩略图、发到 X 上光秃秃一条 URL——几乎全是 Meta 标签的锅。本文讲清 OG 协议是什么、og:image 为什么必须是 1200×630 的 https 绝对路径、标题和描述多长合适、怎么用各平台调试器验证并刷新缓存,以及卡片不生效时按命中率排序的排查清单。
OG 协议是什么
OG(Open Graph)是 Facebook 在 2010 年推出的页面级元数据协议,如今已是事实标准:Facebook、X/Twitter、LinkedIn、WhatsApp、Telegram、Slack、Discord 等几乎所有平台,分享链接时都会读取 <head> 里的 og:* 标签来渲染卡片。核心四件套:
<meta property="og:type" content="website">
<meta property="og:title" content="页面标题">
<meta property="og:description" content="一句话描述">
<meta property="og:image" content="https://example.com/cover.png">
<meta property="og:url" content="https://example.com/page/">
对应的 Twitter Card 体系只多一条关键标签:<meta name="twitter:card" content="summary_large_image">,声明用大图卡片;其余 twitter:title / twitter:description / twitter:image 在缺省时全部回退读取 OG 同名标签。一套 OG + 一条 twitter:card 即可覆盖绝大多数平台。
不想手写的话,用本站 Meta Tag 生成器 填一次标题、描述和图片地址,直接输出完整可粘贴的标签块。
og:image:1200×630 规范
分享卡片上最显眼的是图,也最容易出问题。各平台的公约数:
- 尺寸:1200×630 像素(约 1.91:1)。这是 Facebook 声明的大图标准,X 的 summary_large_image 按同比例设计,LinkedIn、微信兼容良好。更大可以,但平台会自行缩放裁切;
- 最小尺寸:低于 200×200 的图会被降级为小缩略图,部分平台直接不显示;
- 文件体积:按 1 MB 以内 做最保险(Facebook 上限 8 MB,X 上限 5 MB,但体积过大常被抓取超时);
- 格式:JPG 或 PNG 最稳,WebP 支持参差;
- URL:必须是 https 绝对路径,且无需登录即可公网访问。相对路径
/assets/cover.png 是最常见的「图片不显示」原因;
- 构图:关键内容放画面中央,避免边缘文字——各平台裁切策略不同,中央安全区最稳。
每张页面再加 og:image:width / og:image:height 两条标签,可以让平台在抓取图片前就预留版位,加快首屏渲染。
标题与描述的长度
平台对卡片文字没有硬性截断上限,只有「显示不下就省略号」,所以按展示宽度倒推:
| 字段 | 建议长度 | 说明 |
| og:title | ≤ 60 字符(中文约 30 字) | 超出在移动端被截断;别重复 og:site_name |
| og:description | ≤ 110 字符(中文约 55 字) | 约两行;把关键信息放前半句 |
| <title> | ≤ 60 字符 | 兼顾 SEO,可与 og:title 不同 |
| <meta name="description"> | ≤ 160 字符 | 搜索结果摘要用,可比 og:description 长 |
注意 og:title 和 <title> 面向的场景不同:前者是社交信息流里被扫一眼的文案,短、直接、有利益点;后者服务搜索结果,可以带关键词和站名后缀。两者独立撰写效果最好。
调试:验证器与缓存刷新
改完标签不要靠「发给朋友试试」来验证,各平台都有官方调试器,会模拟自己的抓取器访问页面并列出实际抓到的数据:
- Facebook / Meta:Sharing Debugger(developers.facebook.com/tools/debug/)——粘贴 URL 点 Debug,可看到抓取到的全部标签和图片预览;
- X / Twitter:Card Validator(需登录开发者账号);卡片预览直接显示大图效果;
- LinkedIn:Post Inspector;
- 通用:Google Rich Results Test 可作为「抓取器视角看 HTML」的旁证。
调试器还有一个关键功能:重新抓取 = 刷新缓存。Facebook Debugger 点「Scrape Again」,LinkedIn/Post Inspector 重新提交即可。改了标签但分享出去还是旧内容的,九成是缓存问题——先刷抓取,再验证。没有官方调试器的平台(如微信),常用手段是给 URL 加一个无害参数(?v=2)让它变成「新链接」。
常见不生效原因
卡片不生效按命中率排序排查:
1. og:image 不是 https 绝对路径
写了 content="/img/cover.png" 或 http:// 地址。抓取器要求完整、可公网访问的 https URL,相对路径直接解析失败。同理检查图片没有被防盗链、防火墙或登录墙挡住——调试器里的图片预览能立刻暴露这类问题。
2. 平台缓存了旧数据
标签改对了但分享还是旧的:用上文调试器强制重新抓取,或给 URL 加参数。缓存在「改对之后仍然不生效」的原因里占比最高。
3. 缺标签或标签位置错误
OG 标签必须静态存在于服务端返回的 HTML 的 <head> 内。常见坑:标签被前端 JS 动态插入(多数平台抓取器不执行 JavaScript,SPA 页面尤其注意)、被渲染进 <body>、或拼写错误(把 property 写成 name 一般可用,但 og:image 漏写成 og:img 就完全无效)。在调试器里核对「抓到的标签」与源码逐一比对。
这套「按命中率排序、用官方工具看抓取结果」的排障方法,与静态资源类问题同源——Favicon 不显示排查用的正是同一套思路:先确认文件可访问,再查引用路径,最后看缓存。
把标签块生成、复制、粘贴回 <head> 这套流程,用 Meta Tag 生成器 可以一次做完,避免手写漏字段。
常见问题
Q:OG 标签会直接影响 SEO 排名吗?
A:不会直接参与排名算法——Google 主要看 <title>、<meta name="description"> 和正文本身。但 OG 标签决定链接在社交平台上的分享卡片:标题是否抓人、图片是否清晰,直接影响点击率;而点击率与外链传播会间接影响 SEO。一句话:OG 不加分,但没有它分享出去就是一截光秃秃的 URL,损失是实打实的。
Q:og:image 应该用多大的图片?
A:推荐 1200×630 像素(比例约 1.91:1),这是 Facebook 声明的标准大图尺寸,Twitter/X 的 summary_large_image 卡片同样按此设计,微信、LinkedIn 等平台也兼容良好。文件控制在 1 MB、8 MB 以内(不同平台上限不同,按 1 MB 做最保险),格式用 JPG 或 PNG。小于 200×200 的图会被降级成小缩略图甚至不显示。
Q:为什么改了标签,分享出去还是旧内容?
A:因为各平台会抓取并缓存 OG 数据,之后分享同一条链接时直接读缓存。解决办法是用各平台的官方调试器(Facebook Sharing Debugger、Twitter/X Card Validator、LinkedIn Post Inspector)重新抓取一次,抓取即刷新缓存。没有调试器的平台通常换个带参数的 URL(加 ?v=2)也能强制重新抓取。
Q:Twitter Card 和 OG 标签要写两套吗?
A:基本不用。Twitter/X 在缺少专属标签时会回退读取 OG 标签,所以一套完整的 OG(og:title、og:description、og:image)已经能覆盖大多数场景。建议额外只加一条 <meta name="twitter:card" content="summary_large_image">,把卡片声明为大图样式;只有想给 Twitter 单独定制文案或图片时才补 twitter:title 等其余标签。
Q:页面上明明写了标签,为什么平台还是抓不到?
A:按命中率排查:一是标签不在 <head> 里,或被 JS 动态插入——多数平台的抓取器不执行 JavaScript,服务端渲染的 HTML 里必须静态存在;二是 og:image 用了相对路径或非 https 地址,抓取器要求可公网访问的 https 绝对 URL;三是页面或图片需要登录/防火墙才能访问;四是标签拼写错误(og:image 写成 og:image url 等)。用调试器看「实际抓到的标签」与源码逐一比对。
Q:og:title 和 <title> 必须一样吗?
A:不必须,而且通常不该一样。<title> 兼顾 SEO 关键词,常常带「| 站名」后缀、偏正式;og:title 是给人扫一眼的社交文案,可以更短更口语、不带站名(og:site_name 已经单独承担了站名)。最佳实践是两条独立撰写:og:title 控制在 60 字符左右,突出一个利益点或悬念。
What Is the OG Protocol
OG (Open Graph) is a page-level metadata protocol introduced by Facebook in 2010 and now the de facto standard: when a link is shared, Facebook, X/Twitter, LinkedIn, WhatsApp, Telegram, Slack, Discord and most other platforms read the og:* tags in <head> to render the card. The core four:
<meta property="og:type" content="website">
<meta property="og:title" content="Page Title">
<meta property="og:description" content="One-line summary">
<meta property="og:image" content="https://example.com/cover.png">
<meta property="og:url" content="https://example.com/page/">
The Twitter Card system adds only one essential tag: <meta name="twitter:card" content="summary_large_image">, which declares the large-image layout. Everything else — twitter:title, twitter:description, twitter:image — falls back to the matching OG tag when absent. One OG set plus one twitter:card covers nearly every platform.
If you'd rather not hand-write them, the Meta Tag Generator takes a title, description, and image URL once and outputs a complete, paste-ready block.
og:image: The 1200×630 Spec
The image is the most visible part of the card and the easiest to get wrong. The common denominator across platforms:
- Size: 1200×630 pixels (about 1.91:1). Facebook's declared large-image standard; X's summary_large_image is designed to the same ratio; LinkedIn and WeChat handle it well. Larger is fine — platforms scale and crop;
- Minimum: images under 200×200 get demoted to a tiny thumbnail or dropped entirely;
- File size: aim for under 1 MB to be safe (Facebook allows 8 MB, X allows 5 MB, but oversized files often hit crawler timeouts);
- Format: JPG or PNG are safest; WebP support is uneven;
- URL: must be an https absolute URL, publicly reachable without login. A relative path like
/assets/cover.png is the most common "image not showing" cause;
- Composition: keep key content centered — platforms crop differently, and the center is the only safe zone.
Also add og:image:width and og:image:height: they let platforms reserve layout space before the image finishes downloading, speeding first render.
Title & Description Lengths
Platforms have no hard truncation limit — text just gets an ellipsis when it doesn't fit. Plan by display width:
| Field | Suggested length | Notes |
| og:title | ≤ 60 characters | Truncated on mobile; don't repeat og:site_name |
| og:description | ≤ 110 characters | About two lines; front-load the key info |
| <title> | ≤ 60 characters | SEO-facing; may differ from og:title |
| <meta name="description"> | ≤ 160 characters | Search-snippet use; may be longer |
Remember og:title and <title> serve different audiences: the former is scanned in a social feed — short, direct, benefit-led; the latter serves search results, where keywords and a brand suffix help. Writing them independently works best.
Debugging: Validators & Cache Refresh
Don't verify by "sending it to a friend". Every major platform ships an official debugger that simulates its own crawler and lists exactly what it fetched:
- Facebook / Meta: Sharing Debugger (developers.facebook.com/tools/debug/) — paste the URL, hit Debug, and see every fetched tag plus an image preview;
- X / Twitter: Card Validator (requires a developer login) — previews the large-image card directly;
- LinkedIn: Post Inspector;
- Generic: Google's Rich Results Test as a secondary "crawler's view of the HTML".
The debugger also has a second job: re-scraping refreshes the cache. Hit "Scrape Again" in Facebook Debugger, or resubmit in Post Inspector. If you fixed the tags but shares still show old content, it's cache nine times out of ten — re-scrape first, verify second. For platforms without a debugger (like WeChat), appending a harmless query parameter (?v=2) turns the link into a "new" one and forces a fresh fetch.
Why Cards Fail to Render
When the card doesn't render, troubleshoot in this order:
1. og:image isn't an https absolute URL
content="/img/cover.png" or an http:// address. Crawlers require a complete, publicly reachable https URL; relative paths simply fail to resolve. Also check the image isn't blocked by hotlink protection, a firewall, or a login wall — the debugger's image preview exposes these instantly.
2. The platform cached old data
Tags are fixed but shares still show old content: force a re-scrape with the debuggers above, or add a URL parameter. Caching is the top cause among "I already fixed it" reports.
3. Missing tags or wrong placement
OG tags must exist statically in the <head> of the server-rendered HTML. Common pitfalls: tags injected client-side by JavaScript (most crawlers don't execute JS — watch out on SPAs), rendered into <body>, or misspelled (property vs name usually still works, but og:img instead of og:image is silently ignored). Compare the debugger's fetched tags against your source one by one.
This ranked-causes, use-the-official-tool methodology is the same one that solves static-asset issues — the Favicon Not Showing guide follows the identical playbook: confirm the file is reachable, check the reference path, then suspect the cache.
For generating the block, copying it, and pasting it back into <head>, the Meta Tag Generator does it in one pass so no field gets skipped.
FAQ
Q: Do OG tags directly affect SEO rankings?
A: No — Google ranks on <title>, <meta name="description">, and the content itself. But OG tags decide how your link's card looks on social platforms: a compelling title and a crisp image drive click-through, and clicks plus link sharing influence SEO indirectly. In short: OG earns no ranking points, but without it a shared link is a bare URL — and that loss is very real.
Q: How big should og:image be?
A: 1200×630 pixels (about 1.91:1) — Facebook's declared standard, the ratio X's summary_large_image card is designed for, and one that WeChat and LinkedIn handle well. Keep the file under ~1 MB to be safe (platform caps differ; 1 MB avoids crawler timeouts), in JPG or PNG. Images under 200×200 get demoted to small thumbnails or dropped.
Q: Why do shares still show old content after I changed the tags?
A: Platforms fetch and cache OG data, then reuse the cache for every future share of the same URL. Fix it with each platform's official debugger (Facebook Sharing Debugger, X Card Validator, LinkedIn Post Inspector): a fresh scrape refreshes the cache. Platforms without a debugger usually re-fetch if you share a URL with a new query parameter (?v=2).
Q: Do I need both Twitter Card and OG tags?
A: Mostly no. X falls back to OG tags when its own are missing, so one complete OG set (og:title, og:description, og:image) covers nearly everything. Just add <meta name="twitter:card" content="summary_large_image"> to opt into the large-image layout, and only add twitter:title and friends if you want Twitter-specific copy or imagery.
Q: The tags are in my page — why can't the platform see them?
A: Ranked by likelihood: the tags aren't statically in <head> (e.g. injected by JS — most crawlers don't run JavaScript); og:image uses a relative or non-https address (crawlers need a public https absolute URL); the page or image sits behind a login or firewall; or a typo broke the tag. Use the debugger's "fetched tags" view and diff it against your source.
Q: Must og:title match the <title> tag?
A: No — and they usually shouldn't match. <title> serves search results with keywords and a "| Brand" suffix; og:title is social feed copy, so keep it shorter, more conversational, and brand-free (og:site_name handles that separately). Best practice: write them independently, and keep og:title around 60 characters with one clear hook.
Generate Meta Tags — Free Online
OG + Twitter Card in one pass · Live card preview · Runs in your browser
Open Meta Tag Generator →