Sitemap errors: wrong URLs, bad XML and mismatched dates
A sitemap lists the URLs you want search engines to index. Errors appear when the file is missing or returns an error, is not valid XML, is served with the wrong content type, or lists URLs that redirect, return errors, are blocked, are noindex or point to another canonical. List only live, canonical https URLs that can be indexed and keep lastmod honest, so it changes only when the page really changes.
How the problem happens
The sitemap is generated once and never revisited. Pages are removed, moved or set to noindex, but their addresses stay in the file, or every lastmod shows the date of the latest deployment.
Why sitemap errors slow discovery and waste crawling
A sitemap is your own list of the addresses you want indexed. Crawlers still find pages by following links, but the sitemap speeds up discovery of new and deep pages and tells them which version of each address you consider final. Because it is a statement of intent, every error in it is a contradiction the crawler has to work around. A file that does not load or is not valid XML is simply unused. A file full of redirects, error pages, noindex pages or addresses blocked by robots.txt contradicts the rest of your site, so crawlers spend requests on addresses that cannot be indexed and the file stops being a reliable list of final addresses.
The date field matters in the same way. Google uses lastmod to decide what to crawl again, but only if it has proved accurate; dates that are invalid, in the future or changed on every build teach the crawler to ignore the field. Fresh content may then wait longer to be seen, and AI systems built on those indexes may cite it later too. Bing and other engines that accept IndexNow benefit from the same discipline.
How to check a sitemap by hand
Find the file first. Look at the Sitemap: lines in robots.txt, then try /sitemap.xml and /sitemap_index.xml. Open it in a browser and with curl -I and confirm status 200 and a content type of application/xml or text/xml. A sitemap may be compressed, and an index file may point to child sitemaps; each child has to be checked the same way. Limits are 50,000 addresses and 50 MB uncompressed per file.
Validate the XML, then sample the addresses. Request a few dozen with curl -I and look for anything other than 200. Open some of them and check three things: no redirect, no noindex, and a canonical that points to the same address. Compare every host and protocol in the file with your preferred one, and look for admin, API, login or draft paths that should not be submitted.
Finally compare lastmod with reality. For a few pages, check the visible date and the Last-Modified header against the value in the file. The Sitemaps report in Google Search Console lists the status of each file and the number of discovered addresses, which is a quick check that Google reads what you intend.
How to fix sitemaps in code, server and CMS
Generate the sitemap from the same data that builds your pages, not by hand. The rule is simple: list an address only if it answers 200, can be indexed, is its own canonical, is allowed by robots.txt and lives on the same host as the file. Anything else belongs outside the sitemap. That rule removes most findings in one step, and it should be a filter in the generator so that it stays true as the site grows.
Write real dates. Set lastmod to the moment the content last changed in a meaningful way and keep it equal to the date shown on the page and sent in Last-Modified; never use the build time. Google ignores priority and changefreq, so they are optional. Serve the file as application/xml, split above the limits with an index file, and add one Sitemap line with the full address to robots.txt.
In WordPress, let one SEO plugin or the core sitemap produce the file and disable the others; exclude private post types and drafts. For very large sites separate sitemaps by section so you can see which part has problems. For galleries, an image sitemap helps Google Images, and a news sitemap should contain only recent articles.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/pricing</loc>
<lastmod>2026-11-02</lastmod>
</url>
</urlset>
# robots.txt
Sitemap: https://example.com/sitemap.xmlHow RankDossier detects sitemap problems
RankDossier looks for the sitemap in robots.txt and at the usual locations, then loads it and every child file. The checks test whether robots.txt references one, whether the file exists and loads, whether it is valid XML with the expected content type, and whether the dates are valid. It then compares the listed addresses with what the crawl saw: addresses that return errors or redirects, that are noindex, canonical elsewhere, blocked by robots.txt, on another host or private, and lastmod values that differ from the page. Informational checks show whether the file contains image, video or news data and whether a news sitemap holds old articles.
Each finding names the sitemap address and an example of the listed URL that failed. Test any file with the Sitemap validator. The technical SEO audit guide shows where a sitemap sits among the other signals, the guide to pages that are not indexed helps when listed pages stay out of Google, and the site migration guide explains how to update the file during a move.
Wrong and right
Wrong
<url><loc>http://example.com/old-page</loc></url> <!-- redirects -->
<url><loc>https://example.com/private/</loc></url> <!-- noindex -->
Right
<url>
<loc>https://example.com/pricing</loc>
<lastmod>2026-11-01</lastmod>
</url>
How to fix it
WordPress
Use a single sitemap source, either WordPress core or your SEO plugin, switch the other off, and exclude noindex content types from the file.
Next.js
Generate app/sitemap.ts from the same data as your pages, include only canonical URLs, and read lastModified from the content, not from the build date.
// app/sitemap.ts
export default function sitemap() {
return [{ url: 'https://example.com/pricing', lastModified: '2026-11-01' }];
}
Nginx
Serve /sitemap.xml with an XML content type and a successful status, and make sure a redirect or cache rule does not return a different version to crawlers.
location = /sitemap.xml {
default_type application/xml;
}
Check codes in this family
These checks belong to this family. Each code appears in the audit report with its own explanation and fix.
ROBOTS_NO_SITEMAProbots.txt has no Sitemap lineSITEMAP_MISSINGNo XML sitemap foundSITEMAP_HTTP_ERRORSitemap does not loadSITEMAP_INVALID_XMLSitemap is not valid XMLSITEMAP_CONTENT_TYPESitemap has a wrong Content-TypeSITEMAP_LASTMOD_INVALIDInvalid lastmod dates in sitemapSITEMAP_URL_ERRORSitemap lists URLs with errorsSITEMAP_URL_REDIRECTSitemap lists redirecting URLsSITEMAP_URL_NOINDEXSitemap lists noindex pagesSITEMAP_URL_NONCANONICALSitemap lists non-canonical URLsSITEMAP_URL_BLOCKEDSitemap lists URLs blocked by robots.txtSITEMAP_OFFHOSTSitemap lists URLs from another hostSITEMAP_PRIVATE_URLSitemap lists private URLsSITEMAP_LASTMOD_MISMATCHlastmod does not match the real dateIMAGE_SITEMAP_SUGGESTEDMany images without image sitemap or ImageObjectGSC_SITEMAP_ERRORSSitemap errors reported by GoogleSITEMAP_EXTENSIONSImage, video and news sitemapsSITEMAP_NEWS_STALEOld articles in the news sitemap
Related check families
Read the full guide How to run a technical SEO audit and prioritize the fixes for the wider picture. Test one page for free with the Sitemap validator.
Check your own site
Enter a domain – the free pre-check reads up to 10 pages and shows how many types of problems it finds. You pay only if you want the full report.
Start the free pre-check