Sitemap Validation (sitemap-validation)
Summary
XML sitemap fetch/parse, sampled URL checks, and freshness hints.
Classification
- Category:
SEO - Plugin id:
sitemap-validation - Version:
1.0.0 - Target types:
WEBSITE,WEBSHOP - Weight class:
LIGHT - Risk level: not set on plugin object
- Browser required: No (HTTP / Node / other — see source)
- Tier / group: Tier 1 — HTTP-only
Schedule
- scheduleHints:
{ defaultInterval: '0 */6 * * *', priority: 3 } - Prerequisites: None declared on this plugin.
Configurable inputs
Public keys are derived from inputSchema: z.object({ ... }) (underscore-prefixed keys are runtime-only and omitted here).
| Field | Notes |
|---|---|
maxUrls |
Zod field in inputSchema — see source for defaults, min/max, and .describe(). |
checkLastmod |
Zod field in inputSchema — see source for defaults, min/max, and .describe(). |
timeout |
Zod field in inputSchema — see source for defaults, min/max, and .describe(). |
Runtime / injected config
- None documented beyond standard worker context (
target,config,logger,reportProgress). Underscore-prefixed keys are internal.
Checks that produce findings
These checks run inside this plugin during a single test run. They are not separate tests in the database — each becomes a Finding linked to the Run for sitemap-validation.
| Check | Typical severity | Why |
|---|---|---|
| sitemap.xml not found | WARNING | Search engines lose the authoritative URL list — new pages are discovered slower and orphan URLs persist in the index. |
| Invalid XML (no urlset/sitemapindex) | WARNING | Malformed sitemaps may be rejected by Google/Bing parsers — the file is effectively useless for discovery. |
| Empty sitemap (no URLs) | WARNING | Zero <loc> entries teach crawlers nothing and may signal an unmaintained site. |
Stale lastmod dates (older than 1 year) |
INFO | Ancient lastmod values reduce trust in freshness signals; crawlers may deprioritize recrawl of “unchanged” URLs. |
| Broken URL in sitemap (per sampled URL) | WARNING | Listing 404/5xx URLs wastes crawl budget and can pollute the index — especially harmful for large catalogs. |
How each check works
- Fetch — GET
{origin}/sitemap.xml(default timeout 15s). Fetch failure → runfailedwith no findings. - 404 — WARNING missing sitemap; run status
warning, score 0, early return. - Structure — Body must contain substring
<urlsetor<sitemapindex; otherwise WARNING invalid XML, score 20, return. - URL extraction — Regex
/<loc>\s*(.*?)\s*<\/loc>/gcollects URLs. Zero URLs → WARNING empty sitemap. - Lastmod (optional) — When
checkLastmodis true (default), counts<lastmod>values older than 365 days; if any, one aggregated INFO finding withstaleCount. - URL sampling — HEAD-checks first
maxUrlsentries (default 50), batches of 3, 200ms delay between batches,TesteBot/1.0UA, follows redirects. Status ≥ 400 or network error → one WARNING per broken URL. - Score —
max(0, 100 - (brokenCount / sampled.length) × 100)when sampling runs.
Caveats and concerns
- Fixed path — Only
/sitemap.xmlat site root; sitemaps referenced only in robots.txt or on other paths are not followed. - Regex parsing — Not a validating XML parser; namespaces, CDATA, or nested index sitemaps may confuse URL extraction.
- HEAD probes — Some servers allow GET but block HEAD (or return 405), producing false “broken” findings.
- Partial sample — Only the first
maxUrlsURLs are checked; broken links deeper in large sitemaps may be missed.
Source
packages/test-plugins/src/plugins/sitemap-validation.ts