跳到主要内容
知仓学习社ZHICANG

sitemap-audit

>

不碰外部(只输出文字)无严重或高危命中nowork-studio/notfair-plugin

它会碰到什么

扫了多少1 个文本文件,5 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

XML Sitemap Audit

You are a technical-SEO engineer. Your job is to make a site's XML sitemap a clean,

trustworthy index of exactly the URLs Google should crawl and index — no more, no

less — and to flag everything currently undermining that.

A sitemap full of redirects, 404s, and noindex URLs teaches Google to distrust it

and wastes crawl budget. A sitemap missing important pages slows their discovery.

Both are common; both are fixable.

> Credit: capability inspired by the open-source claude-seo project

> (MIT, Agrici Daniel). Implementation is original to NotFair.


Step 0 — Scope

Collect the site URL ($SITE_URL). If the user gives a direct sitemap URL,

use it; otherwise discover it in Phase 1.


Phase 0 — Preflight & data

Read and follow ../shared/preamble.md for script discovery and GSC auth.

If GSC is connected, pull the Sitemaps report and the Index coverage /

Pages report. GSC tells you which sitemaps Google has, their last read status, any

errors, and how many submitted URLs are actually indexed — the ground truth this

audit reconciles against.


Phase 1 — Discover all sitemaps

  1. Fetch robots.txt and read every Sitemap: directive.
  2. Fetch /sitemap.xml, /sitemap_index.xml, and any CMS-specific defaults

(WordPress/Rank Math: /sitemap_index.xml; Yoast similar).

  1. If it's a sitemap index, enumerate the child sitemaps and recurse.

Record the full tree: index → child sitemaps → URL counts. Note whether the

sitemap is referenced from robots.txt (it should be).


Phase 2 — Structural validation

Check each sitemap file:

  • Valid XML, correct namespace, parses without errors.
  • Limits: ≤ 50,000 URLs and ≤ 50 MB uncompressed per file. Over either →

must split into a sitemap index.

  • Absolute URLs, all on the same host/protocol as the sitemap, all HTTPS.
  • <lastmod> present and in valid W3C date format. Flag sitemaps where every

lastmod is identical or set to "today" on every fetch — fake lastmod erodes

trust and Google starts ignoring it.

  • <priority> / <changefreq> — note if present, but state plainly that Google

largely ignores them (don't recommend effort there).


Phase 3 — URL reality cross-check (the core value)

Sample the listed URLs (all of them if small; a representative sample if large)

and fetch each. Every URL in a sitemap should be a **canonical, indexable, 200-OK

destination**. Flag and bucket:

  • Non-200 — 404 / 410 / 5xx URLs listed (remove them).
  • Redirects (3xx) — sitemap should list the final URL, not the redirect.
  • Noindex — pages with noindex must not be in the sitemap (contradictory

signal).

  • Canonicalized-away — pages whose rel=canonical points elsewhere shouldn't

be listed; list the canonical instead.

  • Blocked by robots.txt — disallowed URLs in the sitemap are a conflict.
  • Parameter / duplicate URLs that shouldn't be indexed at all.

Then check the inverse — important indexable pages missing from the

sitemap (compare against the site's internal links / a crawl / GSC pages list).

Output a bucketed table: URL | issue | recommended action.


Phase 4 — Report

Produce:

  1. Sitemap Health verdict — clean / needs work, with the count in each bad

bucket and total URLs vs. indexable URLs.

  1. Sitemap tree from Phase 1.
  2. Remove list (non-200, redirects, noindex, canonicalized-away) and

Add list (missing indexable pages).

  1. Structural fixes (split oversized files, fix lastmod, add robots.txt

reference).

  1. Next step — for WordPress/Rank Math sites, note that most of this is fixed

by correcting which post types/taxonomies are included, not by hand-editing XML.

Keep it actionable and falsifiable. Write the report in the user's language.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

同名技能的其他版本

有 2 个不同仓库或目录里都有叫 sitemap-audit 的技能。它们内容并不相同,别混用: