Sub topic 8
What an XML sitemap does and does not do
This chapter assumes you know what a URL and an HTTP status code are, and that you can read basic XML. It also assumes you have met the difference between crawling and indexing in the earlier chapters.
What a sitemap is
An XML sitemap is a file that lists URLs you want search engines to know about. A crawler reads it as a set of suggestions. It does not have to fetch every URL, and it does not have to index the ones it fetches.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-11-01</lastmod>
</url>
</urlset>Where it fits in the pipeline
A search engine works in stages: it discovers a URL, crawls it, indexes it, and then ranks it for queries. A sitemap helps only with the first stage, discovery. It can also hint at when a page last changed, which may affect when the crawler comes back.
What a sitemap does
- Speeds up discovery. New pages, deep pages, and pages with few internal links get found sooner.
- Helps large or fast-changing sites. It gives the crawler a list so it does not have to rely on following links alone.
- Signals freshness. An accurate
lastmodtells the crawler a page has changed since its last visit. - Gives a canonical list. Many engines treat the URLs you list as the ones you prefer, so list only your canonical versions.
- Supports reporting. Search consoles compare submitted URLs with indexed URLs, which shows where indexing fails.
What a sitemap does not do
| Common belief | Reality |
|---|---|
| Listing a URL gets it indexed | The engine decides. Low-quality or duplicate pages can be skipped. |
| A sitemap improves rankings | Ranking is a separate stage that a sitemap does not touch. |
| Leaving a URL out blocks it | Unlisted pages can still be crawled through links. Use `noindex` or `Disallow` for control. |
| A sitemap overrides robots.txt | A URL blocked in robots.txt is not crawled, even if it is listed. |
| `priority` and `changefreq` steer the crawler | Major engines ignore both fields. |
Practical rules
- Use absolute URLs, including the protocol and the exact host you serve (
https://www.example.com, not a relative path). - List only pages that return 200 and that you want indexed.
- Keep the file in sync with your site. A stale sitemap is worse than a short one.
- Remember that a sitemap is an addition to good internal linking and does not replace it. A page that only appears in the sitemap has no link signals pointing to it, and engines may treat it as less important.
Check your understanding
Exercise
A page is listed in your sitemap but is also disallowed in robots.txt. A teammate says the sitemap entry will make the page appear in search. Is that right, and what should you change?
Show answer
No. The sitemap only suggests the URL for discovery. The robots.txt rule stops the crawler from fetching the page, and a sitemap entry does not override it. Decide which you want: if the page should be searchable, remove the Disallow rule. If it should stay out, remove it from the sitemap, and use noindex on a crawlable page if you need it kept out of the index.
Exercise
Name two sitemap fields that major engines ignore, and one field that is worth keeping accurate.
Show answer
priority and changefreq are ignored. lastmod is worth keeping accurate, as long as it reflects real content changes.