Technical SEO skill 04 of 13
XML Sitemaps SKILL.md
The XML Sitemaps skill makes Claude, Codex or another AI agent plan, generate, audit and monitor sitemaps the way a technical SEO on a large site would. It keeps only canonical, indexable URLs in each file, uses honest lastmod dates, segments sitemaps by template so you can see indexing by section, and covers image, video, news and hreflang sitemaps for programmatic and multilingual sites.
xml-sitemaps/SKILL.md, version 1.1.0, 1,861 words.
By Afeez Adebayo, Marketing, SEO & Growth Expert with 10+ years of experience.
Created 9 October 2026. Updated 10 October 2026. Free to use under CC BY 4.0.
A sitemap is a promise: "these are the URLs I want in your index, and here is when each one last changed." Keep the promise and Google uses the file to discover and refresh pages. Break it with redirects, noindex pages, duplicates and fake dates, and the file becomes noise Google learns to discount.
This skill builds sitemaps that are clean enough to trust and segmented enough to diagnose. Done well, the Search Console Sitemaps report stops being a box you tick and becomes your best indexing dashboard.
Operating principles
- Only list URLs you want indexed: status 200, indexable, self-canonical, not blocked by robots.txt.
lastmodmust be true or absent. A date that changes on every deploy is worse than no date.- Segment by template and batch, so every sitemap answers a question ("how indexed are our converter pages in Spanish?").
- Generate from the source of truth, the same data that builds the pages, after publishing, never from a crawl of yesterday's site.
- A sitemap helps discovery, not quality. It won't make Google index weak pages.
When to use, and when not to
Use it for building or fixing sitemaps, Search Console sitemap errors, big submitted-versus-indexed gaps, new site sections, programmatic launches, migrations and multilingual setups.
Don't use it to fix pages that are crawled but not indexed because of quality (use crawlability-indexation-audit), or as a substitute for internal links (use internal-linking).
Inputs to ask for, in one message
- Every sitemap URL (from robots.txt, the index and Search Console), and which tool generates each.
- The Search Console Sitemaps report: submitted and indexed counts per file, errors, last read date.
- A crawl of the site, ideally including a list-mode crawl of every sitemap URL.
- The number of indexable URLs per template, and which templates make money.
- Languages and countries served, and how alternates are declared today.
The rules (protocol and Google)
| Rule | Detail |
|---|---|
| Size | Up to 50,000 URLs and 50 MB uncompressed per file. Gzip is fine; the limit applies before compression |
| Index files | A sitemap index can list up to 50,000 sitemaps. Indexes can't nest inside indexes |
| URLs | Absolute, canonical, same host and protocol as the sitemap's location unless the other host is verified in Search Console |
| Encoding | UTF-8, entity-escaped (& becomes &) |
lastmod | W3C date format (2026-10-09 or 2026-10-09T08:00:00+00:00). Google uses it only when it is consistently accurate |
priority, changefreq | Ignored by Google. Leave them out |
| Ping | Google retired the sitemap ping endpoint in 2023. Submit in Search Console and reference in robots.txt |
| Image sitemaps | Use image:loc. Google deprecated the other image tags in 2022 |
| News sitemaps | Articles from the last two days only, up to 1,000 URLs per news sitemap |
Raw SKILL.md file
This is the exact file agents read, including the credit header and licence notice. Save it as xml-sitemaps/SKILL.md.
---
name: xml-sitemaps
description: "Plan, generate, audit, segment and monitor XML sitemaps and sitemap indexes, including image, video, news and hreflang sitemaps, honest lastmod dates, and batch segmentation for large, programmatic and multilingual sites. Use whenever someone asks about sitemaps, 'submit sitemap', 'Couldn't fetch', 'Sitemap could not be read', submitted versus indexed gaps, pages missing from sitemaps, how to split or segment sitemaps, sitemap settings in Yoast, Rank Math, Shopify, Webflow or Next.js, or how to get new pages discovered faster."
license: CC-BY-4.0
metadata:
author: Afeez Adebayo
author_url: https://afeezadebayo.com
author_linkedin: https://www.linkedin.com/in/afeez-adebayo/
author_x: https://x.com/za_icon
source: https://afeezadebayo.com/skills-md/marketing/technical-seo/xml-sitemaps/
category: marketing
subcategory: technical-seo
version: "1.1.0"
created: "2026-10-09"
updated: "2026-10-10"
---
# XML Sitemaps
A sitemap is a promise: "these are the URLs I want in your index, and here is when each one last changed." Keep the promise and Google uses the file to discover and refresh pages. Break it with redirects, noindex pages, duplicates and fake dates, and the file becomes noise Google learns to discount.
This skill builds sitemaps that are clean enough to trust and segmented enough to diagnose. Done well, the Search Console Sitemaps report stops being a box you tick and becomes your best indexing dashboard.
## Operating principles
1. **Only list URLs you want indexed:** status 200, indexable, self-canonical, not blocked by robots.txt.
2. **`lastmod` must be true or absent.** A date that changes on every deploy is worse than no date.
3. **Segment by template and batch,** so every sitemap answers a question ("how indexed are our converter pages in Spanish?").
4. **Generate from the source of truth,** the same data that builds the pages, after publishing, never from a crawl of yesterday's site.
5. **A sitemap helps discovery, not quality.** It won't make Google index weak pages.
## When to use, and when not to
Use it for building or fixing sitemaps, Search Console sitemap errors, big submitted-versus-indexed gaps, new site sections, programmatic launches, migrations and multilingual setups.
Don't use it to fix pages that are crawled but not indexed because of quality (use `crawlability-indexation-audit`), or as a substitute for internal links (use `internal-linking`).
## Inputs to ask for, in one message
1. Every sitemap URL (from robots.txt, the index and Search Console), and which tool generates each.
2. The Search Console Sitemaps report: submitted and indexed counts per file, errors, last read date.
3. A crawl of the site, ideally including a list-mode crawl of every sitemap URL.
4. The number of indexable URLs per template, and which templates make money.
5. Languages and countries served, and how alternates are declared today.
## The rules (protocol and Google)
| Rule | Detail |
|---|---|
| Size | Up to 50,000 URLs and 50 MB uncompressed per file. Gzip is fine; the limit applies before compression |
| Index files | A sitemap index can list up to 50,000 sitemaps. Indexes can't nest inside indexes |
| URLs | Absolute, canonical, same host and protocol as the sitemap's location unless the other host is verified in Search Console |
| Encoding | UTF-8, entity-escaped (`&` becomes `&`) |
| `lastmod` | W3C date format (`2026-10-09` or `2026-10-09T08:00:00+00:00`). Google uses it only when it is consistently accurate |
| `priority`, `changefreq` | Ignored by Google. Leave them out |
| Ping | Google retired the sitemap ping endpoint in 2023. Submit in Search Console and reference in robots.txt |
| Image sitemaps | Use `image:loc`. Google deprecated the other image tags in 2022 |
| News sitemaps | Articles from the last two days only, up to 1,000 URLs per news sitemap |
## Workflow: audit
1. **Inventory every file.** Fetch the index and each child; record status code, URL count, size, generator and last modified date.
2. **Validate every listed URL** with a list-mode crawl: status, indexability, canonical, robots. Calculate the clean rate per file. Aim for 98% or more.
| Sitemap | URLs | Clean % | Non-200 | Noindex | Not self-canonical | Blocked | Indexed (GSC) |
|---|---|---|---|---|---|---|---|
3. **Find the gaps:** indexable URLs in the crawl but missing from sitemaps, and sitemap URLs with no internal links (orphans that only the sitemap knows about).
4. **Test `lastmod` honesty:** compare `lastmod` with the real content change date on ten URLs per template. If every URL shows today's date, the generator is stamping build time.
5. **Check duplicates across files:** the same URL in two sitemaps, or two generators (an SEO plugin and a custom script) listing overlapping sets.
6. **Read the Search Console numbers per file** and note which segments lag.
## Workflow: design the structure
Use a sitemap index with child files split by what you want to monitor.
```
sitemap_index.xml
sitemap-pages.xml
sitemap-blog.xml
sitemap-products-1.xml ... sitemap-products-4.xml
sitemap-converters-en.xml
sitemap-converters-es.xml
sitemap-converters-batch-05.xml (programmatic launch batch)
```
Split rules of thumb:
- One file per template that matters commercially.
- One file per language or country version for international sites.
- One file per launch batch for programmatic pages, so you can compare indexing between batches.
- Keep files well under the limits (for example 10,000 to 25,000 URLs), which also makes failures easier to spot.
## Setting lastmod correctly
Use the date the main content last changed in a way a reader would notice: new text, prices, availability, specifications or structured data. Ignore changes to navigation, footers, related-post widgets, view counters and build timestamps. Store this as a field on the content (for example `content_updated_at`) and read it when generating the sitemap; never use file modification time, which changes on every deploy.
## Extensions
- **hreflang in sitemaps:** suits large multilingual sites. Each `<url>` lists every alternate with `xhtml:link`, including itself, and every alternate's entry lists the same set back. Missing return links make Google ignore the pairing.
```xml
<url>
<loc>https://example.com/en/send-money/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/send-money/"/>
<xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/enviar-dinero/"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/send-money/"/>
</url>
```
- **Image sitemaps:** useful when important images load in ways crawlers may miss, such as JavaScript galleries.
- **Video sitemaps:** for pages where a video is the main content, with title, description, thumbnail and content or player location.
- **News sitemaps:** for publishers eligible for Google News; rotate articles out after two days.
## Generating sitemaps by platform
- **WordPress (Yoast, Rank Math):** a sitemap index lives at `/sitemap_index.xml`. Exclude post types and taxonomies that shouldn't rank (tags, attachments, author archives, thin custom post types). Check that noindexed pages drop out automatically.
- **Shopify:** `/sitemap.xml` is generated for you and split by type. Control it by keeping thin pages unpublished or hidden from search.
- **Webflow:** auto-generated; exclude pages with the page setting. Custom code is needed for anything more granular.
- **Next.js (App Router):** build sitemaps from data with `app/sitemap.ts`, split large sets with `generateSitemaps`, and take `lastModified` from the content's real update date.
- **Headless and custom builds:** generate after publish from the same database or CMS that renders the pages, so a sitemap never lists a page that doesn't exist yet.
## Diagnosis by Search Console numbers
| What you see | Likely cause | Next step |
|---|---|---|
| Submitted far above indexed for one segment | Quality, duplication or weak links on that template | Compare with a well-indexed segment; `crawlability-indexation-audit` |
| "Couldn't fetch" | Wrong URL, robots block, authentication, 5xx, or redirect on the sitemap URL | Fetch it as Googlebot; fix status |
| "Sitemap could not be read" or parsing errors | Invalid XML, wrong encoding, HTML error page served | Validate the XML; check the content type |
| Indexed URLs that are in no sitemap | Discovery through links | Confirm those pages are wanted; add them if so |
| Last read date is weeks old | Google sees little value or can't fetch | Check fetch errors and clean rate |
## Worked example: a programmatic site
A site publishes currency converter pages in batches of 2,000. Instead of one big file, it creates one sitemap per batch and per language. After eight weeks, Search Console shows batch 01 at 92% indexed and batch 04 at 31%. Comparing the two shows batch 04 pages have half the unique content and aren't linked from the currency hub. Both are fixed before batch 05 ships, and batch 05 reaches 80% indexed in six weeks. The segmentation turned a vague "programmatic pages aren't indexing" into a specific, fixable cause.
## Monitoring routine
- **Weekly:** Sitemaps report errors and indexed counts per file; flag any segment that drops.
- **Monthly:** list-mode crawl of every sitemap URL; keep the clean rate at 98% or more.
- **Every release:** new templates appear in the right file, removed pages leave, `lastmod` behaves.
- **Migrations:** keep the old-URL sitemap live for a short period so Google re-crawls the redirects, then remove it.
## Ticket template for developers
```
Title: [SEO] Segment product sitemaps and fix lastmod
Why: products.xml lists 118,000 URLs with lastmod = build time; 14% are redirects (crawl, 9 Oct 2026).
Change: Split into sitemap-products-N.xml (max 25,000 URLs each). Exclude non-200, noindex and non-canonical URLs. Set lastmod from content_updated_at.
Acceptance tests:
- Every child file returns 200, valid XML, under 25,000 URLs.
- A list crawl of all sitemap URLs shows 98%+ clean.
- lastmod on 10 sampled products matches their last content edit.
Metric: indexed/submitted per file in Search Console, re-check after 4 weeks.
```
## Output format
```
# Sitemap audit: <site>, <date>
## Summary (three sentences)
## Inventory and health
| Sitemap | URLs | Clean % | Indexed (GSC) | Issues |
## Missing indexable URLs (count and patterns)
## Recommended structure (index and children, with what each one monitors)
## lastmod findings
## Fix list with owners and re-check dates
```
## Common mistakes
- Listing redirects, 404s, noindex or parameter URLs.
- Stamping every URL with today's date.
- Two generators producing overlapping sitemaps.
- One giant file that hides which template is failing.
- Expecting a sitemap to force indexing of thin pages.
- Forgetting to remove old sitemaps after a migration.
## Questions to ask before you recommend changes
- Which templates make money, and are all their indexable URLs listed today?
- What generates the sitemaps, and when do they refresh after content changes?
- Are there URLs that must stay out of search for legal or commercial reasons?
- How are language and country alternates declared today?
## Self-check before you answer
- Is every recommended file clean (200, indexable, self-canonical)?
- Does each segment answer a monitoring question?
- Is `lastmod` tied to real content changes?
- Did I give owners, acceptance tests and a re-check date?
## Official documentation
- Sitemaps overview: https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview
- Build and submit a sitemap: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap
- Large sitemaps and index files: https://developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps
- Image sitemaps: https://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps
- News sitemaps: https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap
- Localised versions (hreflang): https://developers.google.com/search/docs/specialty/international/localized-versions
- Sitemaps protocol: https://www.sitemaps.org/protocol.html
---
Created by Afeez Adebayo, Marketing, SEO & Growth Expert
Website: https://afeezadebayo.com
LinkedIn: https://www.linkedin.com/in/afeez-adebayo/
X: https://x.com/za_icon
Source: https://afeezadebayo.com/skills-md/marketing/technical-seo/xml-sitemaps/
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). You may copy, share and adapt this skill, including for commercial use, as long as you credit Afeez Adebayo and link to the source URL above. Keep this notice in any copy or adapted version.
Workflow: audit
- Inventory every file. Fetch the index and each child; record status code, URL count, size, generator and last modified date.
- Validate every listed URL with a list-mode crawl: status, indexability, canonical, robots. Calculate the clean rate per file. Aim for 98% or more.
| Sitemap | URLs | Clean % | Non-200 | Noindex | Not self-canonical | Blocked | Indexed (GSC) |
|---|
- Find the gaps: indexable URLs in the crawl but missing from sitemaps, and sitemap URLs with no internal links (orphans that only the sitemap knows about).
- Test
lastmodhonesty: comparelastmodwith the real content change date on ten URLs per template. If every URL shows today's date, the generator is stamping build time. - Check duplicates across files: the same URL in two sitemaps, or two generators (an SEO plugin and a custom script) listing overlapping sets.
- Read the Search Console numbers per file and note which segments lag.
Workflow: design the structure
Use a sitemap index with child files split by what you want to monitor.
sitemap_index.xml
sitemap-pages.xml
sitemap-blog.xml
sitemap-products-1.xml ... sitemap-products-4.xml
sitemap-converters-en.xml
sitemap-converters-es.xml
sitemap-converters-batch-05.xml (programmatic launch batch)Split rules of thumb:
- One file per template that matters commercially.
- One file per language or country version for international sites.
- One file per launch batch for programmatic pages, so you can compare indexing between batches.
- Keep files well under the limits (for example 10,000 to 25,000 URLs), which also makes failures easier to spot.
Setting lastmod correctly
Use the date the main content last changed in a way a reader would notice: new text, prices, availability, specifications or structured data. Ignore changes to navigation, footers, related-post widgets, view counters and build timestamps. Store this as a field on the content (for example content_updated_at) and read it when generating the sitemap; never use file modification time, which changes on every deploy.
Extensions
- hreflang in sitemaps: suits large multilingual sites. Each
<url>lists every alternate withxhtml:link, including itself, and every alternate's entry lists the same set back. Missing return links make Google ignore the pairing.
<url>
<loc>https://example.com/en/send-money/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/send-money/"/>
<xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/enviar-dinero/"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/send-money/"/>
</url>- Image sitemaps: useful when important images load in ways crawlers may miss, such as JavaScript galleries.
- Video sitemaps: for pages where a video is the main content, with title, description, thumbnail and content or player location.
- News sitemaps: for publishers eligible for Google News; rotate articles out after two days.
Generating sitemaps by platform
- WordPress (Yoast, Rank Math): a sitemap index lives at
/sitemap_index.xml. Exclude post types and taxonomies that shouldn't rank (tags, attachments, author archives, thin custom post types). Check that noindexed pages drop out automatically. - Shopify:
/sitemap.xmlis generated for you and split by type. Control it by keeping thin pages unpublished or hidden from search. - Webflow: auto-generated; exclude pages with the page setting. Custom code is needed for anything more granular.
- Next.js (App Router): build sitemaps from data with
app/sitemap.ts, split large sets withgenerateSitemaps, and takelastModifiedfrom the content's real update date. - Headless and custom builds: generate after publish from the same database or CMS that renders the pages, so a sitemap never lists a page that doesn't exist yet.
Diagnosis by Search Console numbers
| What you see | Likely cause | Next step |
|---|---|---|
| Submitted far above indexed for one segment | Quality, duplication or weak links on that template | Compare with a well-indexed segment; crawlability-indexation-audit |
| "Couldn't fetch" | Wrong URL, robots block, authentication, 5xx, or redirect on the sitemap URL | Fetch it as Googlebot; fix status |
| "Sitemap could not be read" or parsing errors | Invalid XML, wrong encoding, HTML error page served | Validate the XML; check the content type |
| Indexed URLs that are in no sitemap | Discovery through links | Confirm those pages are wanted; add them if so |
| Last read date is weeks old | Google sees little value or can't fetch | Check fetch errors and clean rate |
Worked example: a programmatic site
A site publishes currency converter pages in batches of 2,000. Instead of one big file, it creates one sitemap per batch and per language. After eight weeks, Search Console shows batch 01 at 92% indexed and batch 04 at 31%. Comparing the two shows batch 04 pages have half the unique content and aren't linked from the currency hub. Both are fixed before batch 05 ships, and batch 05 reaches 80% indexed in six weeks. The segmentation turned a vague "programmatic pages aren't indexing" into a specific, fixable cause.
Monitoring routine
- Weekly: Sitemaps report errors and indexed counts per file; flag any segment that drops.
- Monthly: list-mode crawl of every sitemap URL; keep the clean rate at 98% or more.
- Every release: new templates appear in the right file, removed pages leave,
lastmodbehaves. - Migrations: keep the old-URL sitemap live for a short period so Google re-crawls the redirects, then remove it.
Ticket template for developers
Title: [SEO] Segment product sitemaps and fix lastmod
Why: products.xml lists 118,000 URLs with lastmod = build time; 14% are redirects (crawl, 9 Oct 2026).
Change: Split into sitemap-products-N.xml (max 25,000 URLs each). Exclude non-200, noindex and non-canonical URLs. Set lastmod from content_updated_at.
Acceptance tests:
- Every child file returns 200, valid XML, under 25,000 URLs.
- A list crawl of all sitemap URLs shows 98%+ clean.
- lastmod on 10 sampled products matches their last content edit.
Metric: indexed/submitted per file in Search Console, re-check after 4 weeks.Output format
# Sitemap audit: <site>, <date>
## Summary (three sentences)
## Inventory and health
| Sitemap | URLs | Clean % | Indexed (GSC) | Issues |
## Missing indexable URLs (count and patterns)
## Recommended structure (index and children, with what each one monitors)
## lastmod findings
## Fix list with owners and re-check datesCommon mistakes
- Listing redirects, 404s, noindex or parameter URLs.
- Stamping every URL with today's date.
- Two generators producing overlapping sitemaps.
- One giant file that hides which template is failing.
- Expecting a sitemap to force indexing of thin pages.
- Forgetting to remove old sitemaps after a migration.
Questions to ask before you recommend changes
- Which templates make money, and are all their indexable URLs listed today?
- What generates the sitemaps, and when do they refresh after content changes?
- Are there URLs that must stay out of search for legal or commercial reasons?
- How are language and country alternates declared today?
Self-check before you answer
- Is every recommended file clean (200, indexable, self-canonical)?
- Does each segment answer a monitoring question?
- Is
lastmodtied to real content changes? - Did I give owners, acceptance tests and a re-check date?
Official documentation
- Sitemaps overview: https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview
- Build and submit a sitemap: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap
- Large sitemaps and index files: https://developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps
- Image sitemaps: https://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps
- News sitemaps: https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap
- Localised versions (hreflang): https://developers.google.com/search/docs/specialty/international/localized-versions
- Sitemaps protocol: https://www.sitemaps.org/protocol.html
On this page
- When to use this skill, and when not to
- Example prompts
- Example output
- What the agent needs from you
- How this skill hands off to related skills
- How to run the XML Sitemaps skill step by step
- Situations this skill handles
- What makes this skill different
- Practical tips from real projects
- Frequently asked questions
- Changelog
When to use this skill, and when not to
Use it when you build sitemaps for a new site or template, when Search Console shows sitemap errors or a big gap between submitted and indexed URLs, before and after a migration, or when new pages take too long to be discovered. It is especially useful on large catalogues, listings and programmatic sites, where segmentation shows exactly which templates Google is ignoring.
Don’t use it as the only fix for pages that aren’t indexed. A sitemap helps discovery but doesn’t make thin or orphaned pages worth indexing; diagnose those with the Crawlability and Indexation Audit first.
Example prompts
- “Audit our sitemaps. 48,000 URLs submitted, 19,000 indexed. Search Console export attached.”
- “Design a sitemap structure for 600,000 programmatic route pages so we can track indexing by country.”
- “Our lastmod dates update every night for every URL. Is that a problem, and how do we fix it?”
- “Add hreflang to our sitemaps for en-gb, en-us and fr-fr.”
- “Which URLs should be in the sitemap after we noindex tag archives?”
Example output
The skill returns a fixed structure. A shortened example for an imaginary site:
# Sitemap audit: example.com, 10 October 2026 ## Summary 31% of sitemap URLs are redirects, noindexed or canonicalised elsewhere. lastmod changes daily for every URL, so Google can't trust it. ## Findings | # | Sitemap | Issue | Count | Fix | | 1 | products.xml | Redirecting URLs | 6,200 | Regenerate from canonical list | | 2 | all files | lastmod = build time | 48,000 | Use content-change date | ## New structure sitemap_index.xml > products-1.xml ... products-4.xml, categories.xml, guides.xml, new-7-days.xml
The audit compares every sitemap URL against the crawl, so you see exactly which entries are sending Google mixed signals.
What the agent needs from you
The skill asks for the sitemap index URL, Search Console Sitemaps and Page indexing data, a crawl with status, canonical and meta robots for every URL, how the CMS or build generates sitemaps, how often content changes, and any language or country versions. For large sites it also asks how URLs are grouped by template so it can propose a segmentation that matches your reporting.
How this skill hands off to related skills
Sitemaps depend on clean URL signals elsewhere. Canonical conflicts go to Canonicalization and Duplicate Content, redirecting entries to Redirects and HTTP Status Codes, and the Sitemap line in robots.txt to Robots.txt and Robots Directives. For filter and parameter URLs that should never be listed, it uses Faceted Navigation and URL Parameters. During a move, it supports Site Migration SEO with temporary sitemaps of old URLs.
How to run the XML Sitemaps skill step by step
- Install the skill as
xml-sitemaps/SKILL.md. - Share the sitemap index URL and how sitemaps are generated (plugin, CMS, build script).
- Export Search Console data: the Sitemaps report and Page indexing, so submitted and indexed counts can be compared.
- Add a crawl with status, canonical and meta robots for every sitemap URL.
- Describe the site’s templates and update frequency, so the skill can propose segmentation that matches your reporting.
- Apply the new structure and watch indexed counts per segment over four to eight weeks.
For very large or programmatic sites, segmentation by template is the main win: it shows exactly which page types Google is ignoring.
Situations this skill handles
Sitemaps go wrong quietly. The skill handles these situations:
| Situation | What the skill does |
|---|---|
| Submitted far above indexed | Compares every entry with the crawl to find redirects, noindexed and non-canonical URLs |
| lastmod updates every night | Switches lastmod to the date main content changed, so Google can trust it |
| 600,000 programmatic pages | Splits sitemaps by template and region under one index, with a recent-pages sitemap |
| Multilingual site | Adds hreflang annotations in sitemaps and checks they reference canonical URLs |
| Site migration | Keeps a temporary sitemap of old URLs so Google finds the redirects faster |
| Images or video drive traffic | Adds image or video sitemap entries where they help discovery |
What makes this skill different
Most sitemap advice stops at “submit it in Search Console”. This skill treats the sitemap as a signal that only works when it is trustworthy: canonical, indexable URLs only, honest dates and a structure that lets you see indexing by template.
It also corrects outdated habits. Google ignores changefreq and priority, retired the sitemap ping endpoint, and uses lastmod only when it is consistently accurate. The skill applies those facts instead of repeating old checklists.
Practical tips from real projects
- Name sitemaps by template. Files such as
products-1.xml,guides.xmlandlocations-uk.xmlturn the Sitemaps report into a per-template indexing dashboard. - Keep a “recent” sitemap. A sitemap listing pages published or meaningfully updated in the last seven days helps Google find new content on large sites.
- Generate from the database, not a crawl. Sitemaps built from the source of truth include orphan pages a crawler can’t find, which is exactly what you want to fix.
- Fail loudly. Add a check to your build or monitoring that alerts when a sitemap returns an error, shrinks suddenly or starts listing redirected URLs.
- Reference sitemaps in robots.txt for every host, and submit them in both Search Console and Bing Webmaster Tools; Bing feeds Copilot and other AI answers.
- Don’t list what you don’t want indexed. If a URL is noindexed, canonicalised elsewhere or redirected, it shouldn’t be in any sitemap.
Frequently asked questions
Does every page need to be in the sitemap?
Every page you want indexed should be, and nothing else. Leave out redirects, 404s, noindexed pages, non-canonical duplicates and parameter URLs, because they make the file less trustworthy as a signal.
How big can a sitemap be?
Each file can hold up to 50,000 URLs or 50 MB uncompressed. Larger sites use a sitemap index that lists many files. Smaller files grouped by template are easier to monitor even when you are below the limit.
Does Google use lastmod?
Google says it uses lastmod when it is consistently accurate. If every URL shows a new date every day, it learns to ignore the field. Update it only when the main content changes.
Do changefreq and priority matter?
Google ignores both. The skill leaves them out unless another search engine you care about uses them.
Should I ping Google when the sitemap changes?
No. Google retired the sitemap ping endpoint. Reference the sitemap in robots.txt and submit it once in Search Console; Google re-reads it on its own schedule.
Changelog
- 1.1.0, 10 October 2026: rewritten with template segmentation for large and programmatic sites, honest lastmod rules, hreflang, image, video and news sitemaps, and an audit against crawl data.
- 1.0.0, 9 October 2026: first release.
Use, adapt and share this skill under CC BY 4.0: credit Afeez Adebayo and link to this page.
All Technical SEO skills
- Technical SEO Audit
- Crawlability and Indexation Audit
- Robots.txt and Robots Directives
- Canonicalization and Duplicate Content
- Redirects and HTTP Status Codes
- Site Migration SEO
- Core Web Vitals and Page Experience
- JavaScript SEO and Rendering
- Structured Data and Schema Markup
- Internal Linking and Site Architecture
- Log File Analysis for SEO
- Faceted Navigation and URL Parameters
- LCP Optimisation
- INP Optimisation
- CLS Optimisation
