# XML Sitemap Guide: What to Include, Submit and Fix

> What an XML sitemap does, which URLs belong in it, how to submit it to Google, the limits and tags Google ignores, and how to fix common sitemap errors.

URL: https://seorecheck.com/blog/xml-sitemap-seo-guide · Published: 2026-10-18 · [Українська](https://seorecheck.com/ua/blog/xml-sitemap-seo-guide.md), [Español](https://seorecheck.com/es/blog/xml-sitemap-seo-guide.md)

An **XML sitemap** is a file that lists the URLs on your site you want search engines to find and crawl, often with the date each page last changed. It helps Google discover pages faster, especially on large or new sites. It does not guarantee indexing, and it only helps when it contains clean, canonical, indexable URLs.

Most sitemap problems aren't about a missing file. They come from a file that lists the wrong URLs. This guide covers what belongs in a sitemap, what Google ignores, how to submit one, and how to read the errors.

## What is an XML sitemap and what does it do?

Google [defines a sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview) as "a file where you provide information about the pages, videos, and other files on your site, and the relationships between them." Search engines use it to crawl a site more efficiently and to learn which pages you consider important.

A sitemap is a discovery and hint file, not a command. Google says plainly that a sitemap "doesn't guarantee that all the items in your sitemap will be crawled and indexed." Its Search Console help adds that the "discovered pages" count in the Sitemaps report comes with ["no guarantee that a page URL discovered in a sitemap has been or will be crawled or indexed."](https://support.google.com/webmasters/answer/7451001)

So a sitemap does three useful things:

- **Discovery.** It shows URLs that [internal links](https://seorecheck.com/blog/internal-linking-seo-guide) might not reach quickly, such as new products or deep archive pages.
- **Change signals.** An accurate `<lastmod>` tells Google which pages changed since its last visit.
- **Canonical hints.** Google's duplicate-URL documentation calls sitemap inclusion ["a weak signal that helps the URLs that are included in a sitemap become canonical."](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls)

It won't make a thin page rank, fix a `noindex` tag or get around a robots.txt block.

## Does my website need a sitemap?

Small, well-linked sites can do without one, but most sites gain something from having it. Google says you [might not need a sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview) if your site has "about 500 pages or fewer", is "comprehensively linked internally" and has few media files or news pages. Large sites, new sites with few backlinks, and sites with lots of video, images or news benefit most.

In practice, a sitemap costs almost nothing to maintain, and most platforms create one for you. Google notes that if you use a CMS such as WordPress, Wix or Blogger, it has probably already generated one. The real question is whether your sitemap is accurate, because a bad sitemap points Google at the wrong URLs.

| Site type | Need a sitemap? | Why |
|---|---|---|
| 10–50 page brochure site, well linked | Optional | Googlebot can follow links to every page |
| New site with few external links | Yes | Helps Google find pages it has no other route to |
| Online store with thousands of products | Yes | Deep pages and new products are hard to reach through links alone |
| Blog or news site publishing daily | Yes | Accurate `lastmod` helps Google pick up fresh content |
| Multilingual site | Yes | Can carry hreflang annotations for language versions |

## What should an XML sitemap include?

Include only URLs you want to appear in search: canonical pages that return status 200, aren't blocked by robots.txt and don't carry a `noindex` tag. Every URL should be absolute, use your preferred protocol and host, and match the URL in the page's own canonical tag. Everything else is noise that wastes crawling and sends mixed signals.

Here is a minimal valid file:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/services/roof-repair/</loc>
    <lastmod>2026-09-30</lastmod>
  </url>
  <url>
    <loc>https://www.example.com/blog/how-to-spot-roof-damage/</loc>
    <lastmod>2026-10-12</lastmod>
  </url>
</urlset>
```

### What to leave out

Audits of real sitemaps keep turning up the same kinds of URLs that don't belong there:

- **Redirected URLs** (301/302). List the final destination instead.
- **404 and 410 pages**: deleted products, old campaign pages.
- **Non-canonical duplicates**: URLs with tracking parameters, sorted or filtered listings, HTTP or non-www versions.
- **Noindexed pages**: thank-you pages, internal search results, tag archives you've excluded.
- **URLs blocked in robots.txt.** Listing a URL in the sitemap while blocking it in [robots.txt](https://seorecheck.com/blog/robots-txt-seo-guide) is a direct contradiction.
- **Staging or development URLs** that leaked in from a plugin or a misconfigured build.

When the sitemap and the page disagree, for example the sitemap lists `/shoes?color=red` while that page's canonical points to `/shoes`, Google has to work out which signal to trust. The [canonical tag guide](https://seorecheck.com/blog/canonical-tag-guide) explains how to line those signals up.

## Which sitemap tags does Google actually use?

Google uses `<loc>` and, when it's trustworthy, `<lastmod>`. Its sitemap documentation states that ["Google ignores `<priority>` and `<changefreq>` values"](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap), so setting every page to priority 1.0 or "daily" changes nothing. Other search engines may read them, but you shouldn't count on them for Google.

`<lastmod>` is the tag that matters, and only if it's honest. Google says to use it only when it's "consistently and verifiably accurate", and that it should reflect significant changes to the main content, structured data or links. A changed copyright year in the footer doesn't count.

A common mistake is a sitemap generator that stamps every URL with the time the file was built. If every page claims to have changed today, every day, the date tells Google nothing. Set `lastmod` from the content's real modification date in your CMS, or leave it out.

### Formats and limits

Google's [build-a-sitemap guide](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap) lists the rules:

| Rule | Google's requirement |
|---|---|
| Size per sitemap | 50 MB uncompressed or 50,000 URLs |
| URL format | Fully-qualified, absolute URLs (`https://www.example.com/page/`) |
| Encoding | UTF-8 |
| Formats accepted | XML, RSS/mRSS/Atom 1.0, plain text (one URL per line) |
| Location | Site root recommended, for widest coverage |
| Ignored tags | `<priority>`, `<changefreq>` |

XML is the most flexible format because it supports extensions for images, video, news and alternate language versions. For multilingual sites, you can declare language versions in the sitemap instead of the page head. The [hreflang guide](https://seorecheck.com/blog/hreflang-guide) covers the syntax, including the self-references and return links each version needs.

## How do you handle large sites with a sitemap index?

Once a site passes 50,000 URLs or 50 MB, split the sitemap into several files and list them in a sitemap index. Google's [large sitemaps documentation](https://developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps) says an index can hold up to 50,000 `<loc>` entries, and you can submit up to 500 sitemap index files per site in Search Console.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://www.example.com/sitemap-products.xml</loc>
    <lastmod>2026-10-17</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://www.example.com/sitemap-blog.xml</loc>
    <lastmod>2026-10-12</lastmod>
  </sitemap>
</sitemapindex>
```

Two restrictions catch people out. The referenced sitemaps must be hosted on the same site as the index, unless you've set up cross-site submission. They must also sit in the same directory as the index or deeper. An index at `/public/sitemap_index.xml` can't reference `/sitemap-blog.xml` at the root.

You don't need a huge site to split your sitemap. Separate files for products, categories, blog posts and landing pages make diagnosis much easier. When Search Console shows one file with a low indexing rate, you know which template to look at.

## How do you submit a sitemap to Google?

Submit the sitemap in Search Console's Sitemaps report and reference it in robots.txt. Google [lists these submission methods](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap): the Sitemaps report, the Search Console API, a `Sitemap:` line in robots.txt, and WebSub for RSS or Atom feeds. Using the report together with robots.txt covers both Google and other crawlers.

Step by step:

1. **Find your sitemap URL.** Common locations are `/sitemap.xml`, `/sitemap_index.xml` or `/wp-sitemap.xml` on WordPress. Open it in a browser to confirm it loads.
2. **Add it to robots.txt** on its own line:
   ```
   Sitemap: https://www.example.com/sitemap_index.xml
   ```
3. **Test it.** Google's [Sitemaps report help](https://support.google.com/webmasters/answer/7451001) suggests checking that the URL is reachable with the URL Inspection tool first.
4. **Submit it.** In Search Console, open *Sitemaps*, paste the URL into *Add a new sitemap* and click *Submit*.
5. **Check the status** a few days later.

Google tries to fetch a submitted sitemap right away. Crawling the URLs inside can take much longer, depending on your site.

## How do you read and fix sitemap errors in Search Console?

The Sitemaps report shows one of [three statuses](https://support.google.com/webmasters/answer/7451001): **Success** (fetched and read without errors), **Has errors** (fetched, but with one or more parsing errors) and **[Couldn't fetch](https://seorecheck.com/blog/xml-sitemap-errors-fixes)** (Google couldn't retrieve the file). Each status points to a different fix.

| Status or symptom | Likely cause | Fix |
|---|---|---|
| Couldn't fetch | Wrong URL, file behind login or firewall, robots.txt blocks it, server error | Open the URL in a private window; check robots.txt and server/CDN rules |
| Has errors | Invalid XML, relative URLs, wrong encoding, URLs on another host | Validate the file; use absolute URLs on the verified property |
| Success, but few pages indexed | Sitemap lists redirects, noindexed, duplicate or [thin pages](https://seorecheck.com/blog/thin-content-seo-problems) | Remove non-indexable URLs; improve the pages that matter |
| Discovered count far above real page count | Parameters, filters or old URLs in the generator | Fix the generator's include rules |
| Discovered count far below real page count | Plugin excludes post types, sitemap not updated | Check the generator settings and rebuild |

"Success" only means the file was readable. To see what happened to the listed URLs, open the Page indexing report and filter it by sitemap. If many submitted pages sit under "Discovered – currently not indexed", Google knows they exist but hasn't crawled them. The [guide to that status](https://seorecheck.com/blog/discovered-currently-not-indexed-fix) walks through the usual causes.

### A quick sitemap audit you can run yourself

1. Download your sitemap and count the URLs.
2. Crawl the list and check each URL's status code, canonical, robots meta tag and robots.txt status.
3. Flag any URL that isn't status 200, self-canonical and indexable.
4. Compare the list with your real important pages. Are key services, products or articles missing?
5. Check whether `lastmod` dates are real or just the build time.

If you'd rather not crawl the file yourself, a [free SEORecheck audit](https://seorecheck.com/request) checks whether your sitemap is found and readable and flags listed URLs that redirect, return errors, are noindexed or point their canonical elsewhere. This is one part of a wider [technical SEO audit](https://seorecheck.com/blog/technical-seo-audit) that also covers crawling, rendering and redirects.

## Common sitemap mistakes, and how to avoid them

- **Two competing sitemaps.** An SEO plugin and the CMS core both generate one, with different URL sets. Pick one and disable the other.
- **Sitemap never updates.** A static file uploaded years ago still lists deleted pages. Generate it automatically from your CMS or build.
- **Wrong host or protocol.** The sitemap lists `http://` or non-www URLs while the site serves `https://www.`. Every listed URL then redirects.
- **Fake freshness.** Every `lastmod` equals today. Use real modification dates.
- **Over-reliance.** Pages that exist only in the sitemap, with no internal links, look unimportant. Link to them from relevant pages too.
- **Ignoring split reports.** One giant file hides which section has the problem. Split by page type.

## Key takeaways

- An XML sitemap helps Google discover and recrawl URLs. It doesn't guarantee crawling or indexing.
- List only canonical, indexable URLs that return 200. Leave out redirects, 404s, noindexed and parameter URLs.
- Google ignores `<priority>` and `<changefreq>`. Keep `<lastmod>` accurate or leave it out.
- Limits: 50,000 URLs or 50 MB uncompressed per file. Use a sitemap index beyond that.
- Submit in Search Console and add a `Sitemap:` line to robots.txt.
- "Success" in the Sitemaps report only means the file was readable. Check the Page indexing report for what happened to the URLs.

To see how sitemap findings look next to the rest of a site's issues, browse the [sample report](https://seorecheck.com/sample). The [full sample](https://seorecheck.com/sample/full) shows affected URLs and fixes in detail.

---

## Want to know what to fix on your site?

Get a free SEO audit preview: your score and real issues, with evidence from your pages.

- [Get a free SEO audit preview](https://seorecheck.com/request)
- [See a sample report](https://seorecheck.com/sample)
