canonical-url
它能做什么
这项技能检查每个页面是否为自己声明了唯一的首选地址。适合页面可以通过多个地址访问的网站所有者,例如使用了网址参数的情况。
适用场景
- ✓当页面可以通过网址参数、www 与非 www 版本,或分页列表访问时。
- ✓当页面没有 canonical 标签时。
- ✓当你希望每个页面都指向自己的首选地址时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/canonical-url/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请确保我商店中的每个商品页面都有指向其简洁地址的 canonical 标签。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在页面的 head 中添加或修正 canonical 标签,并使用包含协议和域名的完整网址。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Set canonical URLs for all pages
Duplicate content from URL parameters, www vs non-www, or pagination dilutes ranking signals—canonical tags consolidate these signals to the preferred URL.
Quick Reference
- Canonical URLs tell search engines which version of a page to index
- Prevents duplicate content penalties from URL variations
- Use absolute URLs including protocol and domain
- Self-referencing canonicals are a best practice
Check
Verify that this page has a canonical URL tag and that it points to the correct preferred version.
Fix
Add or correct the canonical URL tag in the head section to prevent duplicate content issues.
Explain
Explain how canonical URLs help search engines understand the preferred version of duplicate or similar pages.
Code Review
Review metadata generation, rendered HTML, structured data, and response headers related to Set canonical URLs for all pages. Flag exact routes or templates where search-facing output violates the rule, and describe how to verify the final page output.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/seo/canonical-url
常见问题
canonical 网址解决什么问题?
这项技能说明,它可以防止重复内容把排名信号分散到同一页面的不同版本上。
页面应该指向它自己吗?
这项技能说明,自引用的 canonical 是最佳实践。
地址应该使用相对路径吗?
不应该。这项技能建议使用包含协议和域名的绝对网址。
详情
作者的原始描述
Use when auditing metadata, crawlability, structured data, or indexability related to Set canonical URLs for all pages. Verify the rendered HTML and HTTP response rather than relying only on source files.
热度
- GitHub 星标
- 75k
- 排名
- #2767
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。