When you’re submitting a sitemap to Google Search Console and see the error:
Incorrect HTTP header content-type: “text/html” (expected: “application/xml”)
…it usually means Googlebot is expecting an XML file but your server is sending it as HTML. This misconfiguration can lead to crawl issues and prevent your site from being indexed properly.
In this tutorial, I’ll walk you through why this happens, how to fix it, and how to make sure your sitemaps are properly configured from an SEO and server perspective.
Why This Error Occurs
Every file served on the web includes an HTTP response header that tells browsers and bots what type of content it is. This is controlled by the Content-Type
header.
Expected | Received |
---|---|
application/xml or text/xml |
text/html |
If your sitemap (usually found at /sitemap.xml
) is not being served with the correct header, search engines might assume it’s just an HTML page — and skip it.
Step-by-Step Guide to Fix the “Incorrect Content-Type” Error:
1: Confirm the Error
Go to Google Search Console → Sitemaps → Check the status.
You’ll see an error like:
Sitemap could not be read
Incorrect HTTP header content-type: “text/html” (expected: “application/xml”)
2: Test the Sitemap URL in Browser and Tools
- Visit your sitemap URL:
https://example.com/sitemap.xml
- Use browser DevTools (Network tab) to check response headers.
-
Or use online tools like https://httpstatus.io
Look for:
Content-Type: text/html ❌ (Incorrect)
Content-Type: application/xml ✅ (Correct)
3: Check Web Server Configuration
Depending on your stack (Apache, NGINX, PHP, or CMS), here’s how to fix it.
For WordPress (Common Case)
-
Check Your Sitemap Plugin
-
- If using Yoast SEO, Rank Math, or All in One SEO, these plugins generate XML sitemaps.
- Sometimes, caching plugins (like WP Rocket) interfere and serve cached HTML versions.
-
Clear Cache
-
Clear your page and server cache.
-
Disable caching for sitemap URLs.
-
-
Force XML Headers via
functions.php
Add this to your theme’sfunctions.php
: -
Disable Pretty Permalinks Temporarily
If your permalinks are broken, WordPress may route to a 404 page (HTML) instead of your XML sitemap.
For Apache (via .htaccess
)
Add this to your .htaccess
file:
For NGINX
In your server config:
Then reload NGINX:
For Static Sitemaps
If you manually created a static sitemap.xml
, make sure your server isn’t treating it like HTML.
-
Open the
.xml
file and ensure it starts with:
-
Confirm MIME type settings on your server or hosting panel (cPanel, Plesk, etc.).
4: Resubmit the Sitemap in Google Search Console
Once fixed:
- Go back to GSC → Sitemaps
- Remove the broken submission
- Re-add your sitemap URL
-
Check that it says “Success” and shows indexed URLs
SEO Impact of Incorrect Content-Type for Sitemaps
- Crawl issues: Googlebot may ignore the sitemap entirely.
- Indexing delay: Pages might not be discovered or indexed efficiently.
- GSC Errors: Sitemap submission shows errors, making it harder to monitor your SEO health.
-
Topical Authority Impact: For sites building topical clusters, missed sitemaps can hurt internal linking and discoverability.
Bonus Tips for SEO-Optimized Sitemaps
- Always use absolute URLs in your sitemap
- Make sure it is UTF-8 encoded
- Don’t include broken or redirected URLs
- Separate image, video, and news sitemaps if needed
- Update sitemap automatically using plugins or cron jobs
Conclusion:
Fixing the Incorrect HTTP Header Content-Type: text/html (expected: application/xml) error is critical for proper sitemap indexing and overall SEO health. Whether you’re running a WordPress site or managing a custom stack, correcting the MIME type is a small technical tweak that can have big SEO rewards.
FAQs:
1. What does “Incorrect HTTP header content-type: text/html (expected: application/xml)” mean?
This error means that your sitemap is being served with the wrong Content-Type
header. Search engines like Google expect XML sitemaps to be delivered with a content type like application/xml
, but your server is sending it as text/html
, which usually indicates an HTML page, not a sitemap.
2. How do I check my sitemap’s Content-Type header?
You can use browser developer tools (Network tab), curl commands, or tools like https://httpstatus.io or https://www.webconfs.com/http-header-check.php. Look for a header like:
3. Can this error affect my site’s SEO?
Yes, absolutely. If search engines can’t read your sitemap, it can:
- Prevent proper crawling
- Delay indexing of new content
- Cause errors in Google Search Console
-
Break the topical authority chain of your internal linking
4. I’m using WordPress with a sitemap plugin. Why am I still getting this error?
This can happen if:
- A caching plugin is serving a cached HTML version of the sitemap
- A misconfiguration in
.htaccess
or server settings overrides the MIME type - There’s a redirect (e.g., sitemap points to a 404 page)
-
The sitemap URL is incorrect (e.g.,
/sitemap
instead of/sitemap.xml
)
5. What is the correct Content-Type for XML sitemaps?
The correct Content-Type
headers are:
application/xml
(preferred)-
text/xml
(also acceptable)
Make sure your server or CMS is serving the sitemap with one of these.
6. How many sitemaps can I have?
Google allows:
- Up to 50,000 URLs per sitemap
- Up to 50MB uncompressed file size
- Multiple sitemaps can be submitted via a sitemap index file
You can also separate sitemaps by content type (e.g., blog posts, products, images, videos).
7. What happens if I ignore this error?
Google may:
- Skip reading your sitemap entirely
- Miss new or updated pages
- Delay the indexing process
-
Fail to understand your site structure properly
Ignoring it is like handing Google a broken table of contents — it affects visibility and ranking.
8. After fixing it, how long does Google take to reprocess the sitemap?
Once you resubmit a valid sitemap in Google Search Console, Google usually processes it within minutes to a few hours, depending on site authority and crawl demand.
Subscribe to Our Marketing Blog with your email (Is it too much too ask?);