跳到正文
Skillpedia
社交媒体75k · #2961

og-url-match

它能做什么

这个技能检查页面的 og:url 和规范链接是否指向完全相同的干净地址。它面向希望分享数据准确、链接预览一致的网站所有者。

适用场景

  • ✓你请智能体检查每个页面的社交分享标签和规范标签是否一致的时候。
  • ✓你的分享数据似乎很少,怀疑分享被分散到不同网址版本的时候。
  • ✓你更改了页面地址,需要同时更新规范标签和社交标签的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/og-url-match/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/og-url-match/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我确保页面上的 og:url 和规范标签完全一致吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会比较每个页面上 og:url 的值与规范链接。如果两者在协议、域名、路径或查询字符串上有差异,它会把 og:url 设为与规范地址一致,并去掉追踪参数。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

OG URL Match

When og:url doesn't match the canonical URL, social platforms track share counts separately for each URL variant—published share counts get split across multiple URLs and appear lower than they actually are.

Quick Reference

  • og:url must exactly match the <link rel='canonical-url'> URL
  • Use absolute HTTPS URLs for both og:url and canonical-url
  • Mismatched URLs cause social platforms to aggregate share counts on the wrong URL
  • og:url should be the clean canonical URL without tracking parameters

Check

Compare the og:url meta tag value with the <link rel='canonical'> href value. Both must be identical absolute HTTPS URLs. Flag any page where they differ, either in protocol, domain, path, or query string.

Fix

Set og:url to exactly the same absolute HTTPS URL as the canonical tag. Remove any UTM parameters, session IDs, or tracking tokens from og:url. If no canonical tag exists, add one and set og:url to match it.

Explain

Social platforms use og:url as the canonical identifier for aggregating share counts and comments. If og:url differs from the canonical tag, shares on the page URL and shares of the og:url accumulate separately, making your content appear less popular than it is and creating attribution confusion.

Code Review

Compare the value of <meta property='og:url' content='...'> with the value of <link rel='canonical' href='...'>. They must be identical character-for-character. Check for: different protocols (http vs https), www vs non-www mismatch, query string differences, trailing slash inconsistencies. Flag any page where the two values differ.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/seo/og-url-match

常见问题

这两个标签为什么需要一致?

社交平台把 og:url 当作分享数和评论的主要标识,两者不一致会把这些数据分开。

这些网址中应该包含追踪代码吗?

不应该。这个技能说,要从 og:url 中去掉 UTM 及类似的追踪参数。

如果页面没有规范标签怎么办?

这个技能说,应该添加一个规范标签,并把 og:url 设为与其一致。

详情

作者的原始描述

Use when auditing Open Graph tags or investigating why social share counts appear low. Applies to any page with both canonical-url and og:url tags.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2961
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能