Community写作与编辑github.com

umairmsm/wp-seo

第五阶段:SEO、多语言支持与重定向管理——确保搜索引擎和 AI 助手理解每个页面,旧 URL 正确跳转,新增语言的体验与原始语言一致。

wp-seo 是什么?

该技能面向 WordPress 站点构建流程中的第五阶段,专注于 SEO 优化、多语言部署和 URL 重定向管理。它严格规定了由 Rank Math 等 SEO 插件统一管理标题、元数据和 schema 图,确保每个页面只有一个权威 schema 图,避免冲突。通过测试用例(`npm run test:seo`)强制检查标题长度、描述、规范链接、H1 标签、语言属性和无 Google 字体请求。结构化数据方面要求 Organization 或 LocalBusiness 只出现一次,并按页面类型(Service、Product 等)添加相应 item type,面包屑导航,FAQ 仅在真实回答问题时使用,且 Offer 必须包含价格。重定向遵循项目内部的规则,将具有流量或反向链接的旧 URL 映射到最相关的新页面(301,一次跳转),并逐一测试。多语言支持以 Polylang 为基础,采用分批上线的策略:先完成翻译基础(语言切换器、hreflang、.po/.mo 字符串),再对关键页面进行人工审查,然后发布。未发布语言通过 302 临时重定向回原始语言,不出现在站点地图、hreflang 或菜单中。验证清单包括:SEO 测试通过、Rich Results 测试干净、站点地图/robots.txt/llms.txt 正确、旧 URL 重定向映射到位、每种额外语言已完成内测和母语审查。该技能适用于 Claude Code、Cursor 等 AI Agent 平台,帮助开发者在 WordPress 项目中系统化地执行 SEO 和多语言工作流,避免常见的错误(如翻译页面的规范链接指向原始页面、外语页面上出现英语 JSON-LD、未发布语言被 301 重定向到首页)。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/umairmsm/wp-site-kit/tree/HEAD/skills/wp-seo

Installed? Explore more 写作与编辑 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

第五阶段:SEO 和多语言

目标:搜索引擎和 AI 助手理解每个页面。旧 URL 落在正确的位置。 每种额外语言与原始语言一样正确。

SEO 步骤

  1. 每项工作只有一个负责人。
    • SEO 插件(默认使用 Rank Math)负责标题、元数据、站点地图和主 schema 图。
    • 核心的 schema.php 将该站点自身的类型添加到该图中。
    • 禁用任何会输出自己 schema 的领域插件,确保只有一个图,而不是两个相互冲突的图。
  2. tests/helpers/site.ts 中的每个页面都通过 npm run test:seo:
    • 标题 10–65 个字符;
    • 描述 50–160 个字符;
    • 绝对规范链接;
    • 一个 H1;
    • lang 属性;
    • 零个 Google Fonts 请求。 检查清单和编写规则:references/seo-checklist.md。
  3. 结构化数据:
    • Organization(或 LocalBusiness)只出现一次。
    • 每个页面所对应的项目类型(Service, Product, TouristTrip, Course...)。
    • 面包屑导航。
    • 仅在页面上真正回答了问题时才使用 FAQ。
    • 绝不出现没有价格的 Offer。
    • 使用 Google 富结果测试和 Schema.org 验证器进行验证。
  4. Robots、站点地图、llms.txt:
    • 线上环境允许爬取并列出站点地图;预发布环境阻止所有爬取(核心代码已完成此操作);
    • /llms.txt 由核心代码提供;
    • 根据用途决定是否允许 AI 爬虫读取网站,然后检查边缘层是否默认阻止了它们(wp-ship > cloudflare-edge.md)。
  5. 重定向: 遵守项目的 docs/reference/REDIRECT_RULES.md。将每个有流量或反向链接的旧 URL 映射到其最相关的新页面(301,一次跳转),并逐一测试。
  6. 重大变更前进行一致性检查。 在重新设计、迁移或语言上线之前,捕捉每个 URL 的标题、描述、规范链接和 H1。每步之后进行比较。仅在有意变更时重新捕捉,并在提交中注明原因。
  7. Search Console 和 Bing:
    • 验证两者;
    • 提交站点地图;
    • 第一个月每周监控页面索引;
    • Search Console 只保存 16 个月的数据,因此请尽早导出或开启批量导出。

语言步骤(每种语言先作为试点)

遵循 references/multilingual.md。简而言之:

  1. 第零条规则: 原始语言不变。其 URL、标题、规范标签和文本保持不变(一致性检查将证明这一点)。
  2. 试点: 语言基础(Polylang、语言切换器、hreflang、.po/.mo 中的字符串),然后是关键页面和主要项目。接着由母语者在预发布环境进行审查,然后发布。
  3. 其余内容 分批进行,每批都经过相同的审查。
  4. 尚未发布的语言 通过 302 重定向到原始语言,并且不出现在任何地方:不在站点地图、hreflang、菜单或语言切换器中。

关卡(在 SITE_STATUS.md 中勾选)

  • npm run test:seo 在预发布环境通过;每种类型的一个页面上 Rich Results 测试干净
  • 线上环境的站点地图、robots.txt 和 llms.txt 正确
  • 旧 URL 重定向映射已就位并经过测试(或填“不适用”)
  • 每个额外语言:试点通过、母语审查完成、hreflang 配对完整、每种语言的规范链接正确

我们曾遇到过的一些错误,请检查它们

  • 翻译后的首页规范链接指向原始首页,导致 Google 在法文结果中删除 /fr/。翻译后的页面的规范链接应该是翻译后的 URL。
  • 法文页面上的英文 JSON-LD:schema 必须跟随页面语言,或者在翻译完成之前省略。
  • 将未发布语言通过 301 重定向到首页的关关卡。关卡 应该是 302。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

umairmsm/wp-build

Stage 3 of a wp-site-kit WordPress build - local DDEV site, the core must-use plugin (modules), the presentation-only child theme with skins, the content model (custom post types, meta, WP_Query, render functions), and the enquiry pipeline that saves leads before forwarding. Use when building or changing features, templates, content types, forms or plugin modules on a wp-site-kit site.

umairmsm/wp-content

Stage 4 of a wp-site-kit WordPress build - real copy and photos. Content truth (facts only from the owner), AI drafts and owner approval, claims audits, banned words and fake proof, legal pages, the photo pipeline (dedupe, real-only, EXIF strip, WebP sizes, alt text, AI image register), and recorded content changes. Use for "write the copy", "add photos", "the owner sent new photos", "check for duplicates", "update prices or text on the live site", "legal pages".

umairmsm/wp-design

Stage 2 of a wp-site-kit WordPress build - design direction, a static HTML/CSS prototype with design tokens, owner sign-off with screenshots, self-hosted fonts, and porting the approved look into a swappable WordPress skin. Use for "design the site", "new look", "redesign", "change colours or fonts", "make a new skin", "port the prototype to WordPress".

umairmsm/wp-kickoff

Stage 1 of a wp-site-kit WordPress build. Use when starting a new WordPress website or taking over or rebuilding an existing one - discovery brief, stack decision, creating the project with bin/wp-site-new, locked decisions, private repo and credentials inventory. Triggers - "new WordPress site", "start a client website", "rebuild this site", "take over this WordPress site".

umairmsm/wp-operate

Stage 8 of a wp-site-kit WordPress build and everything after launch - backups with an off-machine copy, restore drills, the disaster-recovery runbook, credentials inventory, update policy, alerts, and working from more than one machine (bridge file, workstation doctor, encrypted state bundle, rescuing unpushed work). Use for "backup", "restore", "move to a new machine/server", "update plugins", "what if the server dies", "work from the cloud box", "set up a second machine".

umairmsm/wp-ship

Stage 7 of a wp-site-kit WordPress build - staging behind Cloudflare Access, server hardening, safe deploys from a commit (scripts/deploy-safe.sh), database content changes, the launch audit, DNS cutover without breaking a running business, and the first week after launch. Use for "deploy", "set up staging", "go live", "launch", "cutover", "move DNS", "harden the server".

umairmsm/wp-site

Start here for any WordPress website built with wp-site-kit, from an empty folder to a live site. Use when someone says "build a WordPress site", "new website for a client", "where are we on the site", "what is next before launch", or asks to continue a site project. Finds the current stage from SITE_STATUS.md, applies the hard rules, and hands over to the right stage skill.

相关技能