Sitemap Analysis & Generation
Mode 1: Analyze Existing Sitemap
Discover candidates before reporting a sitemap missing:
claude-seo run sitemap_discovery.py <url> --json
The helper reads every bounded Sitemap: declaration in robots.txt, validates
cross-host targets through the shared SSRF-safe fetch layer, and still probes
common paths when a declared sitemap is stale or invalid. Use only entries in
found; preserve declared failures as findings instead of treating a robots.txt
line alone as proof that a sitemap works.
Validation Checks
- Valid XML format
- Per-file limit: ≤50,000 URLs AND ≤50MB uncompressed (whichever is hit first)
- All URLs return HTTP 200
<lastmod> accurate: must be a valid W3C Datetime and reflect the last
significant content change (main content, structured data, links, not
copyright/boilerplate edits). Google only honours <lastmod> when consistently
and verifiably accurate, so warn when values are suspiciously uniform or newer
than the page's real content.
- No deprecated tags:
<priority> and <changefreq> are ignored by Google
- Sitemap referenced in robots.txt
- Compare crawled pages vs sitemap; flag missing pages
Quality Signals
- Sitemap index file if >50k URLs
- Split by content type (pages, posts, images, videos)
- No non-canonical URLs in sitemap
- No noindexed URLs in sitemap
- No redirected URLs in sitemap
- HTTPS URLs only (no HTTP)
Common Issues
| Issue |
Severity |
Fix |
| >50k URLs in single file |
Critical |
Split with sitemap index |
| >50MB uncompressed single file |
Critical |
Split with sitemap index |
| Non-200 URLs |
High |
Remove or fix broken URLs |
| Noindexed URLs included |
High |
Remove from sitemap |
| Redirected URLs included |
Medium |
Update to final URLs |
| All identical lastmod |
Low |
Use actual modification dates |
| Priority/changefreq used |
Info |
Can remove (ignored by Google) |
Extension sitemaps (image / video / news)
Google documents three subtypes with their own rules, validate per-subtype:
- Image (
http://www.google.com/schemas/sitemap-image/1.1): only two valid
tags remain, <image:image> and <image:loc> (max 1,000 <image:image>
per <url>). <image:caption>/<image:geo_location>/<image:title>/
<image:license> were deprecated (2022), flag as info-level removable.
- Video: required
<video:video> with <video:thumbnail_loc>,
<video:title>, <video:description>, plus <video:content_loc> or
<video:player_loc>; mRSS also supported. Flag deprecated/removed tags
(<video:category>, <video:gallery_loc>, <video:price>, <video:tvshow>,
player autoplay/allow_embed) as info-level removable; recheck Google docs before citing a removal date.
- News: max 1,000
<news:news> per file (not 50,000); include only
articles from the last 2 days; required <news:publication>/<news:name>/
<news:language>/<news:publication_date>/<news:title>; submit/discover through
Search Console or robots.txt/sitemap index; use Publisher Center only for
publication management where relevant. When the news: namespace is detected, override the generic
50k check with the 1,000 cap.
Mode 2: Generate New Sitemap
Process
- Ask for business type (or auto-detect from existing site)
- Load industry template from
../seo-plan/assets/ directory
- Interactive structure planning with user
- Apply quality gates:
- ⚠️ WARNING at 30+ location pages (require 60%+ unique content)
- 🛑 HARD STOP at 50+ location pages (require justification)
- Generate valid XML output
- Split at whichever comes first: 50,000 URLs or 50MB uncompressed, with sitemap index
- Generate STRUCTURE.md documentation
Safe Programmatic Pages (OK at scale)
✅ Integration pages (with real setup docs)
✅ Template/tool pages (with downloadable content)
✅ Glossary pages (200+ word definitions)
✅ Product pages (unique specs, reviews)
✅ User profile pages (user-generated content)
Penalty Risk (avoid at scale)
❌ Location pages with only city name swapped
❌ "Best [tool] for [industry]" without industry-specific value
❌ "[Competitor] alternative" without real comparison data
❌ AI-generated pages without human review and unique value
Sitemap Format
Standard Sitemap
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/page</loc>
<lastmod>2026-02-07</lastmod>
</url>
</urlset>
Sitemap Index (for >50k URLs)
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2026-02-07</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-posts.xml</loc>
<lastmod>2026-02-07</lastmod>
</sitemap>
</sitemapindex>
Error Handling
- URL unreachable: Report the HTTP status code and suggest checking if the site is live
- No sitemap found: Run
sitemap_discovery.py and report "not found" only
when its found list is empty after declared and common candidates are checked
- Invalid XML format: Report specific parsing errors with line numbers
- Rate limiting detected: Back off and report partial results with a note about retry timing
Output
For Analysis
VALIDATION-REPORT.md: analysis results
- Issues list with severity
- Recommendations
For Generation
sitemap.xml (or split files with index)
STRUCTURE.md: site architecture documentation
- URL count and organization summary
1---
2name: seo-sitemap
3description: >
4 Analyze existing XML sitemaps or generate new ones with industry templates.
5 Validates format, URLs, and structure. Use when user says "sitemap",
6 "generate sitemap", "sitemap issues", or "XML sitemap".
7user-invocable: true
8argument-hint: "[url or generate]"
9license: MIT
10metadata:
11 source: https://skillmd.com/skills/gabrielmoreira/seo-sitemap
12 author: AgriciDaniel
13 version: "2.2.5"
14 category: seo
15---
16
17# Sitemap Analysis & Generation
18
19## Mode 1: Analyze Existing Sitemap
20
21Discover candidates before reporting a sitemap missing:
22
23```bash
24claude-seo run sitemap_discovery.py <url> --json
25```
26
27The helper reads every bounded `Sitemap:` declaration in robots.txt, validates
28cross-host targets through the shared SSRF-safe fetch layer, and still probes
29common paths when a declared sitemap is stale or invalid. Use only entries in
30`found`; preserve declared failures as findings instead of treating a robots.txt
31line alone as proof that a sitemap works.
32
33### Validation Checks
34- Valid XML format
35- Per-file limit: **≤50,000 URLs AND ≤50MB uncompressed** (whichever is hit first)
36- All URLs return HTTP 200
37- `<lastmod>` accurate: must be a valid **W3C Datetime** and reflect the **last
38 significant content change** (main content, structured data, links, not
39 copyright/boilerplate edits). Google only honours `<lastmod>` when consistently
40 and verifiably accurate, so warn when values are suspiciously uniform or newer
41 than the page's real content.
42- No deprecated tags: `<priority>` and `<changefreq>` are ignored by Google
43- Sitemap referenced in robots.txt
44- Compare crawled pages vs sitemap; flag missing pages
45
46### Quality Signals
47- Sitemap index file if >50k URLs
48- Split by content type (pages, posts, images, videos)
49- No non-canonical URLs in sitemap
50- No noindexed URLs in sitemap
51- No redirected URLs in sitemap
52- HTTPS URLs only (no HTTP)
53
54### Common Issues
55| Issue | Severity | Fix |
56|-------|----------|-----|
57| >50k URLs in single file | Critical | Split with sitemap index |
58| >50MB uncompressed single file | Critical | Split with sitemap index |
59| Non-200 URLs | High | Remove or fix broken URLs |
60| Noindexed URLs included | High | Remove from sitemap |
61| Redirected URLs included | Medium | Update to final URLs |
62| All identical lastmod | Low | Use actual modification dates |
63| Priority/changefreq used | Info | Can remove (ignored by Google) |
64
65### Extension sitemaps (image / video / news)
66
67Google documents three subtypes with their own rules, validate per-subtype:
68- **Image** (`http://www.google.com/schemas/sitemap-image/1.1`): only two valid
69 tags remain, `<image:image>` and `<image:loc>` (max **1,000** `<image:image>`
70 per `<url>`). `<image:caption>`/`<image:geo_location>`/`<image:title>`/
71 `<image:license>` were deprecated (2022), flag as info-level removable.
72- **Video**: required `<video:video>` with `<video:thumbnail_loc>`,
73 `<video:title>`, `<video:description>`, plus `<video:content_loc>` or
74 `<video:player_loc>`; mRSS also supported. Flag deprecated/removed tags
75 (`<video:category>`, `<video:gallery_loc>`, `<video:price>`, `<video:tvshow>`,
76 player autoplay/allow_embed) as info-level removable; recheck Google docs before citing a removal date.
77- **News**: max **1,000** `<news:news>` per file (not 50,000); include only
78 articles from the **last 2 days**; required `<news:publication>`/`<news:name>`/
79 `<news:language>`/`<news:publication_date>`/`<news:title>`; submit/discover through
80 Search Console or robots.txt/sitemap index; use Publisher Center only for
81 publication management where relevant. When the `news:` namespace is detected, override the generic
82 50k check with the 1,000 cap.
83
84## Mode 2: Generate New Sitemap
85
86### Process
871. Ask for business type (or auto-detect from existing site)
882. Load industry template from `../seo-plan/assets/` directory
893. Interactive structure planning with user
904. Apply quality gates:
91 - ⚠️ WARNING at 30+ location pages (require 60%+ unique content)
92 - 🛑 HARD STOP at 50+ location pages (require justification)
935. Generate valid XML output
946. Split at whichever comes first: 50,000 URLs or 50MB uncompressed, with sitemap index
957. Generate STRUCTURE.md documentation
96
97### Safe Programmatic Pages (OK at scale)
98✅ Integration pages (with real setup docs)
99✅ Template/tool pages (with downloadable content)
100✅ Glossary pages (200+ word definitions)
101✅ Product pages (unique specs, reviews)
102✅ User profile pages (user-generated content)
103
104### Penalty Risk (avoid at scale)
105❌ Location pages with only city name swapped
106❌ "Best [tool] for [industry]" without industry-specific value
107❌ "[Competitor] alternative" without real comparison data
108❌ AI-generated pages without human review and unique value
109
110## Sitemap Format
111
112### Standard Sitemap
113```xml
114<?xml version="1.0" encoding="UTF-8"?>
115<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
116 <url>
117 <loc>https://example.com/page</loc>
118 <lastmod>2026-02-07</lastmod>
119 </url>
120</urlset>
121```
122
123### Sitemap Index (for >50k URLs)
124```xml
125<?xml version="1.0" encoding="UTF-8"?>
126<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
127 <sitemap>
128 <loc>https://example.com/sitemap-pages.xml</loc>
129 <lastmod>2026-02-07</lastmod>
130 </sitemap>
131 <sitemap>
132 <loc>https://example.com/sitemap-posts.xml</loc>
133 <lastmod>2026-02-07</lastmod>
134 </sitemap>
135</sitemapindex>
136```
137
138## Error Handling
139
140- **URL unreachable**: Report the HTTP status code and suggest checking if the site is live
141- **No sitemap found**: Run `sitemap_discovery.py` and report "not found" only
142 when its `found` list is empty after declared and common candidates are checked
143- **Invalid XML format**: Report specific parsing errors with line numbers
144- **Rate limiting detected**: Back off and report partial results with a note about retry timing
145
146## Output
147
148### For Analysis
149- `VALIDATION-REPORT.md`: analysis results
150- Issues list with severity
151- Recommendations
152
153### For Generation
154- `sitemap.xml` (or split files with index)
155- `STRUCTURE.md`: site architecture documentation
156- URL count and organization summary