-
Hello Rank Math Team,
I’m currently facing an issue where Google Search Console is not indexing my sitemaps, and it shows the following error:
makefile
Copy
Edit
“Sitemap could not be read”
Reason: X-Robots-Tag: noindex
Affected Sitemaps:/product-sitemap.xml
/page-sitemap.xml
Main /sitemap_index.xml
🔍 What I Have Tried So Far:
I disabled all caching plugins, including WP Rocket and Cloudflare page rules.I changed the theme to a default one (Twenty Twenty-Four).
I removed WooCommerce to see if the issue was related.
I added custom filters in functions.php like:
php
Copy
Edit
add_filter( ‘rank_math/sitemap/headers’, function( $headers ) {
unset( $headers[‘X-Robots-Tag’] );
return $headers;
});
I even tried:php
Copy
Edit
add_action( ‘init’, function() {
if ( function_exists( ‘is_rank_math_sitemap’ ) && is_rank_math_sitemap() ) {
header_remove( ‘X-Robots-Tag’ );
}
});
I also added headers and rules in .htaccess to override it.Flushed all site + CDN cache multiple times.
🧪 Additional Test:
I even disabled the Rank Math sitemap feature, and used manually created static XML sitemaps, which worked perfectly and did NOT return X-Robots-Tag: noindex.After testing, I’ve re-enabled Rank Math sitemaps, but unfortunately, the issue still persists. Google is still not indexing them.
⚠️ Current Status:
robots.txt is correctly configured.The sitemap opens fine in browser.
But Search Console still does not index it due to noindex header.
Please help me find out why the X-Robots-Tag: noindex is still appearing for Rank Math sitemaps, and how I can resolve this.
I would really like to continue using Rank Math’s built-in sitemap system instead of manual files.
Thank you for your assistance!
Site: https://global-pharma.biz/
The ticket ‘Sitemap Not Indexed – X-Robots-Tag: noindex Issue in Search Console’ is closed to new replies.