Fix “X-Robots-Tag Noindex" in RankMath Sitemap | Sitemap Couldn't Fetch Error in Search Console

Опубликовано: 23 Май 2026
на канале: WP Engineer
21
3

Facing "Couldn't fetch" or "Couldn't be read" error in sitemap on Google Search Console?

In this video, I explained the exact reason behind this issue and how to fix it step by step.

Main problem: X-Robots-Tag: noindex in sitemap header.

Learn how to check headers using inspect tool and fix the issue using functions.php.

Code:
------------------------------
/**
X-robot-tag remove
*/

add_filter( 'rank_math/sitemap/http_headers', function( $headers ) {
if ( isset( $headers['X-Robots-Tag'] ) ) {
unset( $headers['X-Robots-Tag'] );
}
return $headers;
});
------------------------------

#seo #wordpress #rankmath #googlesearchconsole #sitemaperror