fixing-metadata
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWorkflow
工作流程
- Identify pages with missing or incorrect metadata (titles, descriptions, canonical, OG tags)
- Audit against the priority rules below — fix critical issues (duplicates, indexing) first
- Ensure title, description, canonical, and og:url all agree with each other
- Verify social cards render correctly on a real URL, not localhost
- Keep diffs minimal and scoped to metadata only — do not refactor unrelated code
- 找出元数据缺失或不正确的页面(包括标题、描述、规范URL、OG标签)
- 根据以下优先级规则进行审计——优先修复严重问题(重复、索引问题)
- 确保标题、描述、规范URL和og:url保持一致
- 在真实URL而非本地环境(localhost)验证社交卡片的渲染效果
- 尽量减少代码变更范围,仅针对元数据进行修改——不要重构无关代码
when to apply
适用场景
Reference these guidelines when:
- adding or changing page titles, descriptions, canonical, robots
- implementing Open Graph or Twitter card metadata
- setting favicons, app icons, manifest, theme-color
- building shared SEO components or layout metadata defaults
- adding structured data (JSON-LD)
- changing locale, alternate languages, or canonical routing
- shipping new pages, marketing pages, or shareable links
在以下场景参考本指南:
- 添加或修改页面标题、描述、规范URL、robots指令
- 实现Open Graph或Twitter卡片元数据
- 设置网站图标、应用图标、manifest文件、主题色
- 构建共享SEO组件或布局元数据默认配置
- 添加结构化数据(JSON-LD)
- 修改区域设置、替代语言或规范路由
- 发布新页面、营销页面或可分享链接
rule categories by priority
按优先级划分的规则类别
| priority | category | impact |
|---|---|---|
| 1 | correctness and duplication | critical |
| 2 | title and description | high |
| 3 | canonical and indexing | high |
| 4 | social cards | high |
| 5 | icons and manifest | medium |
| 6 | structured data | medium |
| 7 | locale and alternates | low-medium |
| 8 | tool boundaries | critical |
| 优先级 | 类别 | 影响程度 |
|---|---|---|
| 1 | 正确性与重复问题 | 严重 |
| 2 | 标题与描述 | 高 |
| 3 | 规范URL与索引 | 高 |
| 4 | 社交卡片 | 高 |
| 5 | 图标与manifest | 中 |
| 6 | 结构化数据 | 中 |
| 7 | 区域设置与替代页面 | 低-中 |
| 8 | 工具边界 | 严重 |
quick reference
快速参考
1. correctness and duplication (critical)
1. 正确性与重复问题(严重)
- define metadata in one place per page, avoid competing systems
- do not emit duplicate title, description, canonical, or robots tags
- metadata must be deterministic, no random or unstable values
- escape and sanitize any user-generated or dynamic strings
- every page must have safe defaults for title and description
- 每个页面的元数据仅在一处定义,避免出现冲突的配置系统
- 不要生成重复的标题、描述、规范URL或robots标签
- 元数据必须是确定的,不能包含随机或不稳定的值
- 对任何用户生成或动态字符串进行转义和清理
- 每个页面必须设置标题和描述的安全默认值
2. title and description (high)
2. 标题与描述(高)
- every page must have a title
- use a consistent title format across the site
- keep titles short and readable, avoid stuffing
- shareable or searchable pages should have a meta description
- descriptions must be plain text, no markdown or quote spam
- 每个页面必须设置标题
- 全站使用统一的标题格式
- 标题应简洁易读,避免关键词堆砌
- 可分享或可被搜索的页面应设置元描述
- 描述必须为纯文本,不能包含Markdown或重复引用内容
3. canonical and indexing (high)
3. 规范URL与索引(高)
- canonical must point to the preferred URL for the page
- use noindex only for private, duplicate, or non-public pages
- robots meta must match actual access intent
- previews or staging pages should be noindex by default when possible
- paginated pages must have correct canonical behavior
- 规范URL必须指向页面的首选地址
- 仅对私有、重复或非公开页面使用noindex指令
- robots元标签必须与实际访问意图一致
- 预览页面或 staging 页面应尽可能默认设置为noindex
- 分页页面必须设置正确的规范URL规则
4. social cards (high)
4. 社交卡片(高)
- shareable pages must set Open Graph title, description, and image
- Open Graph and Twitter images must use absolute URLs
- prefer correct image dimensions and stable aspect ratios
- og:url must match the canonical URL
- use a sensible og:type, usually website or article
- set twitter:card appropriately, summary_large_image by default
- 可分享页面必须设置Open Graph标题、描述和图片
- Open Graph和Twitter图片必须使用绝对URL
- 优先使用正确的图片尺寸和稳定的宽高比
- og:url必须与规范URL一致
- 使用合理的og:type,通常为website或article
- 合理设置twitter:card,默认使用summary_large_image
5. icons and manifest (medium)
5. 图标与manifest(中)
- include at least one favicon that works across browsers
- include apple-touch-icon when relevant
- manifest must be valid and referenced when used
- set theme-color intentionally to avoid mismatched UI chrome
- icon paths should be stable and cacheable
- 至少包含一个可在各浏览器正常显示的网站图标(favicon)
- 相关场景下添加apple-touch-icon
- 使用manifest时必须确保其有效且已正确引用
- 主动设置theme-color,避免与浏览器UI栏颜色不匹配
- 图标路径应稳定且可被缓存
6. structured data (medium)
6. 结构化数据(中)
- do not add JSON-LD unless it clearly maps to real page content
- JSON-LD must be valid and reflect what is actually rendered
- do not invent ratings, reviews, prices, or organization details
- prefer one structured data block per page unless required
- 仅当JSON-LD能清晰对应页面真实内容时才添加
- JSON-LD必须有效且与页面实际渲染内容一致
- 不要虚构评分、评论、价格或机构信息
- 除非必要,每个页面优先使用一个结构化数据块
7. locale and alternates (low-medium)
7. 区域设置与替代页面(低-中)
- set the html lang attribute correctly
- set og:locale when localization exists
- add hreflang alternates only when pages truly exist
- localized pages must canonicalize correctly per locale
- 正确设置html的lang属性
- 存在本地化内容时设置og:locale
- 仅当对应页面真实存在时添加hreflang替代链接
- 本地化页面必须按区域正确设置规范URL
8. tool boundaries (critical)
8. 工具边界(严重)
- prefer minimal changes, do not refactor unrelated code
- do not migrate frameworks or SEO libraries unless requested
- follow the project's existing metadata pattern (Next.js metadata API, react-helmet, manual head, etc.)
- 尽量减少变更,不要重构无关代码
- 除非有要求,不要迁移框架或SEO库
- 遵循项目现有的元数据模式(如Next.js metadata API、react-helmet、手动设置head等)
review guidance
审核指南
- fix critical issues first (duplicates, canonical, indexing)
- ensure title, description, canonical, and og:url agree
- verify social cards on a real URL, not localhost
- prefer stable, boring metadata over clever or dynamic
- keep diffs minimal and scoped to metadata only
- 优先修复严重问题(重复、规范URL、索引)
- 确保标题、描述、规范URL和og:url保持一致
- 在真实URL而非本地环境(localhost)验证社交卡片
- 优先选择稳定、常规的元数据,而非复杂或动态的配置
- 尽量减少代码变更范围,仅针对元数据进行修改