How to check an XML sitemap: a five-minute validation routine
A sitemap can return HTTP 200 and still cause problems: it may list redirected pages, use relative URLs or stamp every entry with the build date. This routine checks the five things that matter, in the order that finds problems fastest.
In this guide
Step 1: find the sitemap
Start at /sitemap.xml on the site’s root. Many platforms serve an index there instead, often named sitemap_index.xml or sitemap-index.xml, which lists several child sitemaps. If neither exists, open /robots.txt and look for a line that starts with “Sitemap:”. That line can point anywhere, including another folder or a different file name.
If none of these places has a sitemap, create one and declare it in robots.txt. A sitemap submitted only in Search Console or through its API reaches Google, but other search engines do not see that submission. The Sitemap line in robots.txt is the simplest way to tell every crawler where the file is.
Step 2: confirm it is a real sitemap
Open the URL in a browser and read the first lines. A page sitemap starts with a urlset element; an index starts with sitemapindex. Google also accepts a plain text file with one URL per line, and RSS or Atom feeds. An HTML page, a login screen or an error message served with a 200 status is not a sitemap, even though the request succeeded.
Check the encoding and escaping too. The sitemaps.org protocol requires UTF-8 and requires characters such as the ampersand to be escaped as & inside a URL. One unescaped ampersand makes the whole file invalid XML, and a strict parser stops reading at that point.
Step 3: check the limits
Google’s sitemap documentation sets two limits for a single file: 50,000 URLs and 50 MB uncompressed. A larger site has to split its URLs across several sitemaps. Listing them in a sitemap index lets you submit one URL instead of each file separately. If a single file is close to either limit, plan the split before new pages push it over.
For an index, open two or three of the child sitemaps as well. An index that returns 200 can still point at children that are missing, empty or broken.
Step 4: read the URLs, not just the count
Every location must be a full, absolute URL, including the protocol and host. Relative paths such as /blog/post are invalid. Under the sitemaps.org protocol, a sitemap can only list URLs in its own directory and below, so a file at /blog/sitemap.xml should not list pages under /shop/.
Then look at which URLs are listed. A sitemap is a list of pages you want indexed, so it should contain the final canonical URL of each page. Watch for http URLs on an https site, URLs that redirect, parameter variants of the same page and pages that are blocked or set to noindex. Each of these sends search engines a mixed message.
| What you see | Why it matters | Fix |
|---|---|---|
<loc>/blog/post</loc> | Relative URLs are invalid | Output the full https URL |
http:// on an https site | Every entry redirects | Generate URLs from the canonical host |
?utm_source= variants | Duplicates of one page | List only the clean canonical URL |
Noindex or blocked pages | Asks for indexing of pages you exclude | Remove them from the sitemap |
Try it: review a short sitemap
This sitemap returns 200 and looks tidy, but it has two faults and one thing worth checking. The second entry uses a relative URL. The third contains an unescaped ampersand, which breaks the XML. All three lastmod values also share one timestamp. That can be legitimate if the pages really changed together, but it is worth confirming that the generator is not writing its build time instead of each page’s change date.
Fix the generator, not the file: output absolute URLs from the canonical host, escape special characters, and take lastmod from each page’s real modification date. Then open the live sitemap in a browser to confirm it parses, and run it through Sitemap Checker for the remaining checks.
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://example.com/</loc><lastmod>2026-11-25T08:00:00Z</lastmod></url>
<url><loc>/pricing</loc><lastmod>2026-11-25T08:00:00Z</lastmod></url>
<url><loc>https://example.com/search?q=boots&page=2</loc><lastmod>2026-11-25T08:00:00Z</lastmod></url>
</urlset>Step 5: check lastmod, and ignore priority
Google’s documentation says it ignores the priority and changefreq values, so there is no need to tune them. It does use lastmod, but only when the value is consistently and verifiably accurate. When every entry carries the same timestamp, check whether the generator wrote its build time instead of each page’s real change date. That is a common way for lastmod to stop meaning anything.
If your platform cannot produce real modification dates, leaving lastmod out is better than filling it with the build time. Sitemap Checker reviews the lastmod pattern and flags files where the dates may be generated rather than real.
Confirm what Google actually read
A validator can tell you the file is correct. Only Search Console can tell you what Google did with it. Submit the sitemap URL in the Sitemaps report, then check its status: Success means Google fetched and parsed it, while “Couldn’t fetch” or “Has errors” points back to steps 1 and 2.
The report also shows how many URLs Google discovered from the file. Compare that number with the count in your sitemap. A large gap is worth investigating: Google may not have been able to read part of the file, or an index may point at children it cannot fetch.
What a sitemap check cannot tell you
A clean sitemap helps discovery, but it does not make pages rank or guarantee that they are indexed. Search engines still decide whether each page is worth indexing. If Search Console shows many pages as “Discovered – currently not indexed”, the cause is usually the pages or the site’s overall signals, not the sitemap format.
Recheck the sitemap after migrations, CMS changes and URL structure changes. Those are the moments when generators start emitting old hosts, redirected URLs or a fresh timestamp on every entry.
Frequently asked questions
How do I check if my XML sitemap is valid?
Open it in a browser and confirm it starts with urlset or sitemapindex, then check that it stays under 50,000 URLs and 50 MB, uses absolute URLs and escapes special characters. Sitemap Checker confirms from the live URL that the file is reachable, has a recognised structure, stays within the limits and lists valid absolute URLs, and it reviews the lastmod pattern and sampled child sitemaps. It does not run strict XML validation, so check escaping by opening the file in a browser, which reports XML syntax errors.
Where can I find a website’s sitemap?
Try /sitemap.xml first, then common index names such as /sitemap_index.xml. If neither exists, open /robots.txt and look for a line starting with Sitemap:. A site can also submit a sitemap only in Search Console, in which case it may not be discoverable from outside.
Does Google use priority and changefreq?
No. Google’s sitemap documentation says it ignores both values. It uses lastmod when the dates are consistently accurate, so spend your effort on real modification dates instead.
Why does Search Console say it couldn’t fetch my sitemap?
Usually the URL returns an error, redirects, is blocked by robots.txt, or returns something that is not a sitemap, such as an HTML error page. Open the exact submitted URL in a private browser window, confirm a 200 response with XML content, and fix the server or the URL before resubmitting.