Hello,
We apologize for the issue you are facing with the x-robots-tag: noindex still being active on your sitemap. Thank you for providing detailed information about your setup and the steps you’ve already taken.
Since you have already unchecked the option to add the x-robots-tag in the sitemap settings and confirmed that your server is not setting this header, we recommend checking for any potential plugin conflicts or additional settings that might be affecting this.
Here are a few steps you can take to troubleshoot this issue:
-
Check for Plugin Conflicts: Use the Health Check plugin to identify if any other plugins are causing this conflict.
-
Exclude Sitemap from Caching: Ensure that your sitemap is not being cached by any caching plugins. You can refer to our tutorial on how to exclude sitemaps from caching.
-
Check .htaccess Rules: Double-check your .htaccess file to ensure that the rule you added is correctly formatted and placed. It should look like this:
Header unset x-robots-tag
-
Theme Functions: Sometimes, themes may have custom functions that could affect headers. Check your theme’s functions.php
file for any code that might be adding the x-robots-tag.
If these steps do not resolve the issue, please reply to this ticket with any additional details or changes you’ve made, and a human agent from our support team will assist you further.
Thank you for your patience, and we look forward to helping you resolve this issue!
Sources:
How to Fix "Incorrect HTTP Header Content-Type" Error in Sitemaps » Rank Math
Hello,
Thank you for your detailed reply and troubleshooting suggestions.
I have carefully followed all recommended steps:
The Rank Math option for the sitemap noindex header is disabled.
The .htaccess file contains the correct directive:
Header unset x-robots-tag
I verified that no caching plugin is caching the sitemap.
I also reviewed the functions.php file of my active theme (Astra) — no x-robots-tag header is added there.
The Health Check & Troubleshooting plugin shows no plugin conflict.
Despite all this, the sitemap still responds with:
x-robots-tag: noindex
(Tested with curl -I https://content-design-freelance.de/sitemap_index.xml)
Can you please advise if there is any known issue with the free version of Rank Math where this behavior cannot be overridden?
I would appreciate further assistance from a human agent if needed.
Best regards,
Assia Werner
Hello,
Please note that RankMath sets the “noindex” tag on your sitemaps by default. It’s done this way because a sitemap is only meant to guide search engines through your site, not to rank in search results.
The reason you’re seeing it set to “noindex” is to prevent it from appearing in search results, which is the desired behavior.
You should follow this guide to properly submit your sitemap:
https://rankmath.com/kb/submit-sitemap-to-google/
However, if you still wish to remove the noindex tag from your sitemap, you can use the filter on your site:
add_filter( 'rank_math/sitemap/http_headers', function( $headers ) {
if ( '/sitemap_index.xml' !== $_SERVER['REQUEST_URI'] ) {
return $headers;
}
unset( $headers['X-Robots-Tag'] );
return $headers;
} );
Here’s how you can add a filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Looking forward to helping you.
Thank you very much! That helped.
Hello,
Glad that helped.
If you have any other concerns, please don’t hesitate to contact us anytime so we can assist you further.
Looking forward to helping you.