Hello,
We apologize for the issue you are facing with your sitemap returning the X-Robots-Tag: noindex
header. This can indeed cause problems with Google Search Console reporting errors for submitted URLs.
The X-Robots-Tag: noindex
header is not intentionally added by Rank Math for sitemaps. It usually indicates that there might be a configuration issue or a conflict with another plugin or server settings.
To resolve this issue, you can try the following steps:
-
Check Your Robots.txt File: Ensure that there are no rules in your robots.txt
file that might be blocking the sitemap. You can check this in the Rank Math settings under Rank Math SEO → General Settings → robots.txt.
-
Disable Caching for Sitemaps: If you are using a caching plugin, make sure to exclude your sitemap from being cached. You can refer to our tutorial on how to exclude sitemaps from caching.
-
Check for Plugin Conflicts: Sometimes, other plugins may interfere with the headers sent by Rank Math. You can use the Health Check plugin to identify any conflicts.
-
Server Configuration: If the above steps do not resolve the issue, it may be necessary to check your server configuration or contact your hosting provider to ensure that there are no server-level rules adding the noindex
header.
If you continue to experience issues after trying these steps, please reply to this ticket with any additional details, and a human agent from our support team will assist you further. Thank you for raising this concern!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
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.
You should only submit your sitemap to the sitemap section of your GSC account and shouldn’t use the URL inspection tool for the sitemap URLs.
https://rankmath.com/kb/submit-sitemap-to-google/
In case you still want to index your sitemap, you can use the following filter on your website:
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/
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.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.