SEO

How to Check and Validate Your XML Sitemap

How to check and validate your XML sitemap: find it, test every URL for errors, understand sitemap limits, and fix the most common problems.

HandyUtils August 12, 2026 9 min read

An XML sitemap is one of the simplest ways to help search engines find every page on your site—but only if it actually works. A sitemap with broken links, invalid XML, or a URL that returns a 404 quietly undermines the very thing it's supposed to help. This guide covers how to find your sitemap, what a good sitemap checker validates, the limits you need to respect, and how to fix the errors that show up most often.

What Is an XML Sitemap?

An XML sitemap is a machine-readable list of the URLs on your site that you want search engines to discover and crawl. Instead of relying purely on crawlers following links from page to page, you hand them a structured index of everything worth indexing.

At its core, a sitemap is a <urlset> containing one <url> entry per page:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-08-01</lastmod>
  </url>
  <url>
    <loc>https://example.com/about</loc>
    <lastmod>2026-07-15</lastmod>
  </url>
</urlset>

The <loc> element is the full, absolute URL of the page. The optional <lastmod> tells search engines when the page last changed, which can help them prioritize re-crawling. You may also see <changefreq> and <priority>, but Google largely ignores those two—<loc> and <lastmod> are the elements that matter.

How to Find Your Sitemap

If you're not sure where your sitemap lives, check the common locations first:

  • /sitemap.xml — the conventional default, e.g. https://example.com/sitemap.xml
  • /sitemap_index.xml — used by many CMS platforms (WordPress with Yoast, for example) when the site is split across multiple sitemaps
  • /sitemap-index.xml or /sitemaps.xml — less common variants

The most reliable pointer is your robots.txt file. Open https://example.com/robots.txt and look for a Sitemap: line:

Sitemap: https://example.com/sitemap.xml

This is where search engines look, so if the reference here is wrong or missing, that alone can cause discovery problems. (See our robots.txt guide for the full picture on how that file works.)

Finally, Google Search Console shows every sitemap Google knows about under Indexing → Sitemaps, along with the status of each one and how many URLs it discovered.

What a Sitemap Checker Validates

Finding the file is only the first step. A sitemap checker confirms that the file is genuinely usable by a search engine. A thorough check covers:

  • Reachability — the sitemap URL returns an HTTP 200 status, not a 404, 403, or 500.
  • Valid XML — the document is well-formed, correctly encoded (UTF-8), and uses the proper <urlset> namespace.
  • URL count — the number of <loc> entries, so you can confirm it's neither empty nor over the limit.
  • <lastmod> format — dates follow the W3C Datetime / ISO 8601 format (2026-08-01 or 2026-08-01T12:00:00+00:00).
  • Nested sitemap index files — when the file is a <sitemapindex>, the checker follows each child <sitemap> and validates those too.
  • robots.txt reference — the sitemap is actually advertised in robots.txt so crawlers can find it.

Our Sitemap URL Checker goes a step further and tests every URL inside the sitemap. It requests each <loc> and reports the HTTP status, so you can see broken links and 404s, pages that redirect instead of returning the live URL, and response times across the whole set. A sitemap full of URLs that 404 or redirect wastes crawl budget and sends search engines a confusing signal—catching those is often the highest-value part of the check.

Sitemap Limits You Should Know

The sitemaps protocol sets hard limits on a single file:

Limit Value
Maximum URLs per sitemap 50,000
Maximum uncompressed file size 50 MB

If your site exceeds either limit, you split your URLs across multiple sitemaps and list them all in a sitemap index file:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-1.xml</loc>
    <lastmod>2026-08-01</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-2.xml</loc>
    <lastmod>2026-08-01</lastmod>
  </sitemap>
</sitemapindex>

Each child sitemap is still bound by the same 50,000-URL / 50 MB limits. You can also gzip sitemaps (sitemap.xml.gz) to reduce transfer size—the 50 MB limit applies to the uncompressed content. Even if you're nowhere near the ceiling, keeping individual sitemaps smaller (a few thousand URLs each) makes them faster to fetch and easier to debug.

Common Sitemap Errors and How to Fix Them

Most sitemap problems fall into a handful of categories. Here's how to recognize and fix them:

Error Cause Fix
Sitemap not found / 404 The file doesn't exist at the URL you submitted, or the path/filename is wrong Confirm the exact URL loads in a browser; regenerate the sitemap and place it at the root; update the Sitemap: line in robots.txt
Couldn't fetch Server error, timeout, or the URL redirects before serving the file Check for 5xx errors and slow response times; serve the sitemap directly with a 200 and no redirect chain
URL blocked by robots.txt A Disallow rule blocks the sitemap itself or the pages it lists Remove the offending Disallow rule, or narrow it so it doesn't cover indexable content
Invalid XML Unescaped characters (&, <), wrong encoding, or a malformed/missing namespace Escape special characters (&amp;), save as UTF-8, and validate the <urlset> namespace; regenerate with a proper tool
URLs return 404/redirect Listed pages have been deleted, renamed, or moved to HTTPS/new paths Remove dead URLs and replace redirected ones with their final destination so every <loc> returns 200
Too many URLs The sitemap exceeds 50,000 URLs or 50 MB Split into multiple sitemaps and reference them from a <sitemapindex> file

A quick way to catch the last two rows at scale is to run the sitemap through the Sitemap URL Checker, which flags every non-200 URL in one pass instead of you spot-checking by hand.

How to Submit Your Sitemap to Google

Once your sitemap is valid and every URL checks out, tell search engines where it is. There are two complementary methods:

1. Google Search Console. Go to Indexing → Sitemaps, enter your sitemap path (e.g. sitemap.xml), and click Submit. Search Console will report the status, the number of discovered URLs, and any errors it encounters on future fetches. Bing Webmaster Tools offers an equivalent submission flow.

2. robots.txt. Add a Sitemap: directive so any crawler that reads your robots.txt finds the sitemap automatically:

Sitemap: https://example.com/sitemap.xml

You can list multiple Sitemap: lines if you have several. This is the most portable method because it isn't tied to any single search engine. If you need to build or update that file, our robots.txt Generator handles the syntax for you.

Submitting a sitemap doesn't guarantee indexing—it's a strong hint, not a command—but it dramatically speeds up discovery, especially for new pages and large sites.

Frequently Asked Questions

How do I check my sitemap?

Open the sitemap URL in a browser to confirm it loads and returns valid XML, then run it through a sitemap checker to test the file itself and every URL inside it. Our Sitemap URL Checker reports the HTTP status of each <loc>, so you can spot 404s, redirects, and slow pages in one pass.

Why is my sitemap not found?

The most common causes are a wrong file path, a sitemap that was never generated, a Disallow rule in robots.txt blocking it, or a redirect that sends the crawler somewhere else before the file loads. Confirm the exact URL returns a 200 in a browser, then make sure your robots.txt Sitemap: line points at that same URL.

How many URLs can an XML sitemap have?

A single sitemap can contain up to 50,000 URLs and must be no larger than 50 MB uncompressed. If you need more, split the URLs across multiple sitemaps and reference them from a sitemap index file.

How do I validate sitemap XML?

Validation means confirming the document is well-formed, UTF-8 encoded, and uses the correct <urlset> (or <sitemapindex>) namespace, with properly escaped characters and valid <lastmod> dates. A checker automates this and also flags problems the raw XML can't reveal, like URLs that return errors. If you're building a sitemap from scratch, our Sitemap Generator produces valid XML for you.

Do I need a sitemap for SEO?

Small, well-linked sites can often be crawled without one, but a sitemap is strongly recommended for larger sites, new sites with few inbound links, and sites with pages that aren't reachable through normal navigation. It won't force pages to rank, but it makes discovery faster and more reliable—and it pairs well with solid on-page meta tags.

Summary

  • An XML sitemap is a list of URLs (<loc>, plus optional <lastmod>) that helps search engines discover your pages.
  • Find yours at /sitemap.xml or /sitemap_index.xml, via the Sitemap: line in robots.txt, or in Google Search Console.
  • A good check confirms reachability, valid XML, URL count, <lastmod> format, nested index files, and the robots.txt reference—and tests every URL for 404s, redirects, and slow responses.
  • Respect the limits: 50,000 URLs and 50 MB per sitemap; use a sitemap index beyond that.
  • Fix broken and redirected URLs so every <loc> returns 200, then submit via Search Console and robots.txt.

Ready to see what's wrong with your sitemap? Run it through our Sitemap URL Checker to validate the file and test every URL for errors.

Related Topics
sitemap checker validate sitemap xml sitemap sitemap error checker sitemap validation check sitemap sitemap not found
Share this article

Continue Reading

SEO
robots.txt: Controlling Search Engine Crawlers

A complete guide to robots.txt, including syntax, common patterns, and how to use it to control which pages search engines can access.

SEO
Meta Tags for SEO: The Essential Guide

Understanding HTML meta tags and how to optimize them for search engines, social sharing, and better click-through rates.