XML Sitemap Not Working? 9 Common Reasons and Fixes
An XML sitemap that is not working will prevent Google from discovering and indexing your pages. Here are the 9 most common reasons a sitemap fails and exactly how to fix each one.
1. Sitemap Returns a Non-200 Status Code
Visit your sitemap URL directly. If you get a 404, 500, or any non-200 response, Google cannot access it. Check your server configuration, verify the sitemap file exists at that exact URL, and confirm there are no authentication requirements blocking access.
2. Wrong Content-Type Header
Your server must return your sitemap with a content-type of application/xml or text/xml. Some servers return text/html which causes parsing failures. Check your headers using curl or httpstatus.io. On Apache, add a .htaccess rule: AddType application/xml .xml.
3. Invalid XML or Parse Errors
Even a single invalid character breaks the entire sitemap. Common causes: unescaped ampersands (use & not &), non-UTF-8 characters, or a server error message printed before the XML declaration. Validate your sitemap at validator.w3.org.
4. URLs Blocked or Redirecting
Google Search Console will report errors for sitemap URLs that return non-200 status codes, redirect to other URLs, or are blocked by robots.txt. Clean your sitemap so it only contains canonical, final-destination URLs that return 200.
5. Sitemap Exceeds Size Limits
A single XML sitemap cannot exceed 50,000 URLs or 50MB uncompressed. If your site is large, split into multiple sitemaps and reference them from a sitemap index file at your root URL.
6. Not Referenced in Robots.txt
Add Sitemap: https://yourdomain.com/sitemap.xml to your robots.txt file. This helps search engines find your sitemap even if they have not been told about it via Search Console. Use an absolute URL, not a relative one.
7. Not Submitted to Google Search Console
Just publishing a sitemap is not enough. Submit it explicitly in Google Search Console under Sitemaps. This triggers an immediate fetch and gives you error reports. After submission, wait 24-48 hours and check the status.
8. Incorrect Domain or Protocol in URLs
All URLs in your sitemap must match your canonical domain exactly. If your site uses HTTPS, all sitemap URLs must use HTTPS. If your site uses www, all URLs must include www. Mixed protocols or domains cause indexing inconsistencies.
9. CMS Plugin Generating a Broken Sitemap
In WordPress, conflicts between multiple active sitemap plugins, or plugin updates introducing bugs, can break your sitemap. Deactivate all but one sitemap plugin and re-validate your sitemap after each change.
10. Sitemap Not Linked from Robots.txt
If your sitemap URL is not declared in robots.txt, some crawlers may never find it unless you submit it manually to each search engine. Add 'Sitemap: https://yourdomain.com/sitemap.xml' as a line in your robots.txt file. This declaration is absolute-URL-only — relative paths do not work. Having the sitemap referenced in both robots.txt and Search Console provides the most reliable coverage across Googlebot, Bingbot, and other crawlers.
11. Noindex on the Sitemap Page Itself
Some CMS configurations accidentally apply a noindex meta tag or X-Robots-Tag header to the sitemap URL itself. While Googlebot generally ignores noindex on XML sitemaps, some crawlers and validation tools will flag it. Check your sitemap URL with a header inspection tool — the response should return 200 with Content-Type: application/xml and no X-Robots-Tag: noindex header. If your sitemap is generated by a page-based route in your CMS, ensure the SEO plugin is not adding noindex to it.
12. Gzip Compression Causing Parse Failures
Serving your sitemap compressed (sitemap.xml.gz) is valid and reduces bandwidth, but it requires your server to set the correct Content-Encoding: gzip header and return the file with a .gz extension or via content negotiation. Misconfigured compression — where the file is sent gzip-encoded but the header is missing — causes parsers to receive garbled data. Test by fetching your sitemap with 'curl -I yoursite.com/sitemap.xml' and checking the response headers. If in doubt, serve the uncompressed XML version, which is simpler to debug.
13. Sitemap Cached at CDN with Stale URLs
If your site uses a CDN or reverse proxy cache, your sitemap may be cached and serve stale content for hours or days after you publish new pages. Google might be fetching a version of your sitemap that does not include your latest content. Purge the cache for your sitemap URL after every publish event. Configure your CDN to set a short TTL (5–30 minutes) on sitemap responses, or exclude your sitemap URL from caching entirely. This ensures Googlebot always gets the current version of your sitemap.