sitemap-valid
它能做什么
这个技能检查 XML 站点地图的结构,包括命名空间、网址格式、大小限制和特殊字符,并修复问题。它面向手动或用代码生成站点地图的网站所有者和开发者。
适用场景
- ✓你请智能体检查站点地图文件是否有效的时候。
- ✓你提交站点地图时 Search Console 显示错误的时候。
- ✓你的站点地图变得很大,需要拆分为多个文件的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/sitemap-valid/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“Google Search Console 说我的站点地图有错误。请帮我检查文件是否有效并修复它吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会按照标准站点地图格式检查文件,确认命名空间、绝对地址和大小限制。它会对 & 等特殊字符进行编码,并将超大的文件拆分为多个站点地图,再通过索引文件进行关联。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Keep XML sitemaps valid
An invalid or malformed sitemap is silently ignored by search engines, leaving newly published or orphaned pages undiscovered by crawlers.
Quick Reference
- The root element must be
<urlset>with the correctxmlnsnamespace - Each
<url>must contain exactly one<loc>element with a fully qualified, percent-encoded URL - Maximum 50,000 URLs and 50 MB per sitemap file; use a sitemap index for larger sites
- Encode XML special characters:
&→&,<→<,>→>,"→",'→'
Check
Fetch the sitemap and validate it against the sitemaps.org schema. Check that the xmlns attribute is http://www.sitemaps.org/schemas/sitemap/0.9, all <loc> values are absolute URLs, no file exceeds 50,000 URLs or 50 MB, and special characters are properly XML-encoded.
Fix
Re-generate the sitemap using a validated sitemap library. Encode all special characters in URLs (& → &). Split oversized sitemaps into multiple files and reference them from a sitemap index. Resubmit to Google Search Console.
Explain
Explain the sitemaps.org XML schema requirements, what causes validation errors in Google Search Console, and how encoding errors in <loc> URLs prevent crawlers from fetching those pages.
Code Review
Review metadata generation, rendered HTML, structured data, and response headers related to Keep XML sitemaps valid. 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/sitemap-valid
常见问题
大小限制是多少?
这个技能说,每个站点地图文件最多可包含 50,000 个网址和 50 MB,更大的网站应使用站点地图索引。
& 符号为什么重要?
这个技能说,网址中的特殊字符必须编码,否则可能破坏文件,并导致抓取工具无法读取该地址。
应该如何修复站点地图?
这个技能建议使用经过验证的站点地图库重新生成,然后重新提交到 Search Console。
详情
作者的原始描述
Use when applies to any site with a manually or programmatically generated XML sitemap. Use when debugging sitemap submission errors in Google Search Console.
热度
- GitHub 星标
- 75k
- 排名
- #3023
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。