Hello,
We apologize for the issue you are facing with the X-Robots-Tag: noindex header in your sitemap. It sounds like you’ve already taken several steps to resolve this, which is great.
To further troubleshoot this issue, please ensure that your posts and pages are set to index in the robots meta tag. If any of your pages are set to noindex, they will not appear in the sitemap, and this could potentially lead to the header being added.
You can check this by navigating to Rank Math SEO → Advanced tab in the post editing screen. Make sure that the settings are configured correctly for all relevant pages.
If the problem persists after confirming these settings, it might be beneficial to check for any plugin conflicts. You can use the Health Check plugin to help identify if another plugin is causing this issue.
If you still cannot resolve the issue, we recommend replying to this ticket with any additional details or screenshots of your settings, and a human agent from our support team will assist you further.
Thank you for bringing this concern to our attention, and we look forward to helping you resolve it!
Sources:
Can I NoIndex PDF Files Using an SEO Plugin? » Rank Math
This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.
Subject: Persistent X-Robots-Tag: noindex Header on Sitemap Despite Full Troubleshooting
Hi Rank Math Team,
I’m experiencing an issue where the X-Robots-Tag: noindex
header is being applied to my sitemap (https://justkidsngr.com/sitemap_index.xml
), and I’ve exhausted all recommended troubleshooting steps without success.
Here’s everything I’ve done so far:
– Added the recommended filter:
add_filter( ‘rank_math/sitemap/x_robots_tag’, ‘__return_false’ );
– Tried the anonymous function version of the filter
– Added .htaccess
rules to unset the header
– Cleared LiteSpeed cache (currently disabled to eliminate caching interference)
– Confirmed with my host (DomainKing) that no server-level headers are being injected
– Enabled Troubleshooting Mode via the Health Check plugin
– Tested with only Rank Math active and a default WordPress theme (Twenty Twenty-Five)
Despite all this, the X-Robots-Tag: noindex
header still appears on the sitemap. I’ve verified this using tools like httpstatus.io .
Could you please confirm whether this is a known issue or bug, and advise if there’s another way to disable the header? I’d appreciate any guidance or backend fix you can offer.
Thanks so much,
Justkids
Hello,
Please note that the sitemaps are by default set to Noindex as they are meant to be crawled and not to be displayed on search results pages. Even though it is set to Noindex, Google can crawl and read this without any issues.
However, if you want to index your sitemap, you can use the following filter on your website:
add_filter( 'rank_math/sitemap/http_headers', function( $headers ) {
$request_uri = $_SERVER['REQUEST_URI'];
// Match all sitemap URLs, including sitemap_index.xml and sitemap*.xml
if ( preg_match( '/(sitemap_index|sitemap\d*)\.xml$/', $request_uri ) ) {
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/
After applying the filter, please clear your sitemap cache by following this screencast: https://i.rankmath.com/pipRDp
Let us know how it goes. Looking forward to helping you.
Thank you.