How to Audit an XML Sitemap: Errors, Limits and Pages That Do Not Belong
A step-by-step sitemap audit: protocol errors, date formats, duplicates, wrong hosts, crawl cross-checks and how to produce a clean, split file.

An XML sitemap is a list of the URLs you want search engines to crawl, with an optional date for each one's last change. Almost every site has one, and almost nobody looks at it after setup, because a plugin or build script writes it automatically. That is exactly why sitemaps collect problems: they keep listing pages that now redirect, pick up tracking parameters, mix hosts, or carry a date format that crawlers cannot read. Occasionally a single character breaks the whole file.
A sitemap audit takes a few minutes and catches all of this.
The protocol in brief
A sitemap file is an XML document with a urlset root element in the sitemaps.org namespace. Each url element contains a loc with an absolute URL and, optionally, lastmod, changefreq and priority. One file may hold up to 50,000 URLs and up to 50 MB uncompressed. Larger sites split their URLs over several files and list those in a sitemap index, which uses the same limits.
Because it is XML, special characters must be escaped. An ampersand inside a URL has to be written as &, or the parser stops and the whole file fails.
Step one: structure
Paste the file into the XML Sitemap Validator and Auditor, or open it, including gzip-compressed .xml.gz files in browsers that support decompression. The validator first checks the file as a whole: the root element and namespace, unescaped ampersands, unbalanced tags that suggest a truncated file, and the entry and size limits. It recognises sitemap indexes and plain URL lists too.
Step two: every entry
Each entry is then checked with its line number. The loc must be an absolute http or https URL with no spaces, fragments or unencoded non-ASCII characters, and under 2,048 characters. Tracking and session parameters are flagged, because a sitemap should list canonical URLs only. Duplicates are found after normalising the host and fragment.
lastmod must follow the W3C Datetime format, either a date like 2026-10-30 or a full timestamp with a time zone. Slashes, day-first dates and future dates are flagged. changefreq must be one of seven words, and priority must be between 0.0 and 1.0. Set your site root and any URL on another host is reported, which catches the common www and non-www mix-up.
Step three: whole-file signals
Some problems only show across the file. Mixing http and https URLs, or several hosts, suggests the generator is not using your canonical settings. When every entry has the same lastmod, usually the date the file was generated, crawlers learn to ignore the field. Google also ignores changefreq and priority entirely, so they can be dropped.
Step four: cross-check with a crawl
The most valuable part of an audit compares the sitemap with what the URLs actually return. Paste a crawl export with URL, status code, indexability and canonical columns. The tool lists sitemap URLs that redirect, return errors, are non-indexable or canonicalise elsewhere, all of which waste crawl attention and send mixed signals. It also lists indexable pages that the crawl found but the sitemap leaves out.
Step five: a clean file
Untick URLs you want to drop, choose whether to add the missing indexable pages and whether to remove changefreq and priority, and download a clean urlset. Invalid dates and values are dropped rather than copied over, duplicates are merged, and lists above 50,000 URLs are split into numbered files with a matching sitemap index.
An example
A blog's sitemap has six entries. The audit finds a lastmod written with slashes, a changefreq of sometimes, an http URL on the www host, a utm_source parameter, a lastmod in the future and the home page listed twice. The crawl export shows that one URL now returns 301 and that the contact page is indexable but missing. After unticking the redirected URL and the www entry and adding the contact page, the cleaned file holds four URLs, and only the tracking parameter remains to be fixed in the blog's settings.
Limits
The validator works on files you provide. It does not fetch your sitemap or its URLs, because browsers block reading other sites, and it cannot tell whether search engines will crawl or index a URL. Fix the generator as well as the file, or the same problems will return with the next build.



