跳到正文
Skillpedia
SEO75k · #3023

sitemap-valid

它能做什么

这个技能检查 XML 站点地图的结构,包括命名空间、网址格式、大小限制和特殊字符,并修复问题。它面向手动或用代码生成站点地图的网站所有者和开发者。

适用场景

  • ✓你请智能体检查站点地图文件是否有效的时候。
  • ✓你提交站点地图时 Search Console 显示错误的时候。
  • ✓你的站点地图变得很大,需要拆分为多个文件的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/sitemap-valid/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 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 correct xmlns namespace
  • 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: & → &amp;, < → &lt;, > → &gt;, " → &quot;, ' → &apos;

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 (& → &amp;). 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.

repo: thedaviddias/Front-End-Checklist

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能