Most sitemaps are made once, by a plugin or a website builder, and never looked at again. Over the years they fill up with old addresses that redirect, pages you hid from Google, and duplicates nobody meant to create. This lesson shows you what belongs in an XML sitemap, what to leave out, and how to keep its dates honest.
No code needed. You'll need about 20 minutes and your sitemap's address (usually yoursite.com/sitemap.xml).
New here? This is lesson 2 of the Technical SEO series. It works on its own, so you can start right here.
📘 Free guide: Want this lesson's sitemap checklist, plus a monthly health check you can run in 30 minutes? It's all in the free Technical SEO Guide, with a one-page checklist for every lesson in this series.
🦉 Remember from last lesson?
What are the two main ways Google discovers a new page?
- A) Social media posts and emails
- B) Links from pages it already knows, and your XML sitemap
- C) Only by you clicking Request indexing
Show the answerHide the answer
B) Links and sitemaps. A sitemap tells Google a page exists, and a link also tells it the page matters. Use both. Missed it? Lesson 1: Crawling and indexing, explained simply covers it. Today we look closely at the sitemap.
Meet Blue Cove Kayaks
In this series we follow Blue Cove Kayaks (bluecove-kayaks.example), a family-run sea-kayaking tour company on Naxos. Blue Cove is made up. Its problems are real ones most small sites run into, but its story is an example, not real results.
Blue Cove's website has 24 pages they want people to find: the homepage, the tour pages, About, Contact, Prices and their blog posts. When they opened their sitemap for the first time, it listed 212 addresses. And every single one said it had changed that morning.
What a sitemap is for
An XML sitemap is a file that lists the addresses you want search engines to find. It helps with discovery, the very first step of crawling. It's most useful when:
- your site is new and few other sites link to it
- your site is large
- some pages sit many clicks away from the homepage
What a sitemap doesn't do: it doesn't guarantee a page gets indexed, and it doesn't help you rank. It's a list of suggestions.
A good way to think of it: a sitemap is a list of promises. Every address in it promises Google three things:
- This page exists.
- This is the version I want shown.
- It's worth showing.
Here's a minimal sitemap with two pages:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://bluecove-kayaks.example/</loc>
<lastmod>2026-09-12</lastmod>
</url>
<url>
<loc>https://bluecove-kayaks.example/tours/sunset-kayak-tour</loc>
<lastmod>2026-08-30</lastmod>
</url>
</urlset>
<urlset>wraps the whole list.- Each
<url>is one page. <loc>is the page's full address. It's the only part that's required.<lastmod>is the date the page last changed. It's optional.
Older sitemaps often have <priority> and <changefreq> too. Google ignores both, so you can leave them out.
What belongs, and what doesn't
Include an address only if all three are true:
- It loads normally. It answers with "200 OK", not a redirect or an error.
- It can be indexed. No noindex, and not blocked in robots.txt.
- It's the main version. If the page has a canonical tag, the sitemap lists the same address it points to. Both are hints to Google, so they should agree.
Leave out:
- Redirects. List the final address instead.
- Error pages, like "not found" (404) or server errors.
- Pages with a noindex. Listing them says "find this" and "don't show this" at the same time.
- Duplicates: with and without a trailing slash, with tracking codes like
?utm_source=, or thehttpandhttpsversions of the same page. - Filter, sort and search addresses. A shop can create thousands of them from one category.
- Utility pages: cart, checkout, login, thank-you pages.
Only the second belongs in the sitemap. The first is the same page, filtered and sorted.
A short, clean list is better than a list of every address your site can produce.
🦉 Quick check
Blue Cove's old /evening-tour page now redirects to /tours/sunset-kayak-tour. Which address belongs in the sitemap?
- A)
/evening-tour - B)
/tours/sunset-kayak-tour - C) Both, to be safe
Show the answerHide the answer
B) Only the final address. /evening-tour doesn't load normally, it redirects. Listing it breaks the first promise. The sitemap should only list pages that answer "200 OK".
What was in Blue Cove's 212 addresses
Blue Cove pasted their sitemap address into the XML sitemap checker. Here's what it found:
| What | How many | Belongs? |
|---|---|---|
| Real pages they want found | 24 | ✅ Yes |
| Image attachment pages, one for every photo, each with just the photo on it | 131 | ❌ No, thin pages nobody searches for |
Blog tag pages, like /blog/tag/naxos (already set to noindex) |
40 | ❌ No, they're noindex |
Old addresses that now redirect, like /evening-tour |
12 | ❌ No, list the final address |
| Booking thank-you, checkout and account pages | 5 | ❌ No, utility pages |
The plugin added everything WordPress could produce, including a page for every uploaded image. They switched off the image attachment and tag sitemaps in the plugin's settings. The 12 redirects were old pages still saved as drafts, so they deleted the drafts and kept the redirects. They set the 5 utility pages to "Hide from search engines", which also takes a page out of the plugin's sitemap. The sitemap went from 212 addresses to 24.

Scout's mistake: "I added every page of my site to the sitemap, including the ones I'd hidden with noindex. I thought more pages meant more chances to rank." A sitemap with pages you've asked Google not to show sends mixed signals, and Search Console reports them as problems. List only the pages you want in Google. More addresses doesn't mean more traffic.
Keep lastmod honest
<lastmod> is the date a page last changed in a way that matters. Google uses it, but only when your dates are consistently accurate.
The usual failure: the website stamps every page with today's date every time it rebuilds the sitemap. That's what happened to Blue Cove. Every page said it had changed that morning, so the dates told Google nothing.
Changes that count: a rewritten section, new prices, a new tour, new opening hours. Changes that don't: a new year in the footer, or a fixed typo.
A wrong date is worse than no date. If your website can't produce true dates, leave <lastmod> out. That's the honest option.
Blue Cove's plugin had a setting to use each page's "last edited" date instead of the rebuild date. One click.
🦉 Spot the mistake
Blue Cove updates the copyright year in the footer on 1 January. Their sitemap now says all 24 pages changed on 1 January. What's the problem?
- A) Nothing, the pages did change
- B) A footer year isn't a meaningful change. If every date jumps for changes like that, Google learns to ignore Blue Cove's dates
Show the answerHide the answer
B) lastmod should only move when the content that matters changes. Dates that change for every small edit become noise, and Google stops trusting them.
Where it goes, and what to do when it grows
A sitemap usually lives at the root of the site, like /sitemap.xml. Most website builders create one automatically, so check before you make your own. Lesson 3 shows where to look on each builder.
There are two ways to tell Google where it is, and you can use both:
- A line in robots.txt:
Sitemap: https://bluecove-kayaks.example/sitemap.xml
- Google Search Console, under Indexing → Sitemaps. Lesson 3 walks through it step by step.
Size limits and sitemap index files
One sitemap file can hold up to 50,000 addresses and 50 MB (uncompressed). If you have more, split them into several files and list those in a sitemap index:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://www.example.com/sitemap-pages.xml</loc></sitemap>
<sitemap><loc>https://www.example.com/sitemap-posts.xml</loc></sitemap>
</sitemapindex>
<sitemapindex>is a list of sitemaps instead of a list of pages.- Each
<sitemap>points to one sitemap file.
Then you submit only the index. Splitting helps even on small sites: with pages, posts and products in separate files, it's easier to see where a problem is. On very big sites, a clean sitemap helps Google spend its crawl budget on the pages that matter.
One more thing: a sitemap doesn't replace links. A page that's in the sitemap but has no links to it is still hard for Google, and impossible for visitors, to reach. An internal linking plan you can reuse fixes that.
🔎 From my own audits: WordPress sitemaps are where I find the most clutter. It's common to see thousands of category, tag and author pages listed alongside a few dozen pages that actually matter. Most SEO plugins let you switch those types off in a couple of clicks.
Must do vs go deeper
✅ Must do (about 20 minutes)
Open your sitemap, or paste its address into the XML sitemap checker, and check:
- Does every address load normally, with no redirects or errors?
- Is every listed page one you want to appear in Google?
- Are there duplicates, filter addresses or search result pages?
- Are the lastmod dates true, or is every page stamped with the same date?
- Is the sitemap named in robots.txt and submitted in Search Console?
🔍 Go deeper (optional)
- Look at your plugin or builder's sitemap settings. Can you switch off types you don't need, like image attachment, author or tag sitemaps?
- If your site has more than a few hundred pages, split the sitemap by type and use a sitemap index.
- In Search Console, open Indexing → Pages and filter by your sitemap. Which listed pages aren't indexed, and why?
- Check that the canonical tag on each key page matches the address in your sitemap.
🦉 What would you do?
Blue Cove's blog has 40 tag pages with a noindex, so visitors can browse by topic but the tag pages stay out of Google. The plugin lists them all in the sitemap. What do you suggest?
- A) Keep them in the sitemap, so Google can find the posts through them
- B) Take the tag pages out of the sitemap. Keep the noindex, and list the blog posts themselves instead
- C) Remove the noindex so the sitemap is right
Show the answerHide the answer
B) A noindex page doesn't belong in the sitemap. The posts it links to should be in the sitemap on their own. Google can still follow the links on the tag pages, so nothing gets lost. Lesson 10 explains why the noindex is the right choice for them.
Quick recap
- An XML sitemap helps Google discover pages. It doesn't guarantee indexing, and it doesn't help you rank.
- Think of it as a list of promises: this page exists, it's the version to show, and it's worth showing.
- Leave out redirects, errors, noindex pages, duplicates, filter addresses and utility pages.
- Keep lastmod honest, or leave it out. Google ignores priority and changefreq.
- Up to 50,000 addresses or 50 MB per file. Bigger sites use a sitemap index.
- A sitemap doesn't replace internal links.
Your task (20 minutes): Run your sitemap through the XML sitemap checker and remove everything that doesn't belong.
Lesson 2 of 11 done 🎉
The guide for the Technical SEO series: the full checklist, free by email.
Next up, lesson 3: How to create an XML sitemap and submit it to Google. Blue Cove's clean sitemap was ready. But Search Console was still reading an old one, from a website they'd replaced two years ago. You'll learn how to find your sitemap, make one if you have none, and submit it properly.
Want to check one page's basics too? Run the free SEO audit.
Sources and further reading
- Learn about sitemaps (Google Search Central)
- Build and submit a sitemap (Google Search Central)
- Manage your sitemaps with sitemap index files (Google Search Central)
- Sitemaps XML format (sitemaps.org)