x-robots-tag: noindex

#1051481
  • Resolved pixel8r99
    Rank Math free

    Hi there,

    I’ve identified an issue where your plugin injects an x-robots-tag: noindex header on the sitemap_index.xml file.

    This header:

    – Prevents proper indexing behavior in some cases
    – Is not configurable in the Rank Math UI
    – Disappears when the plugin is deactivated

    Even Google’s own documentation suggests not blocking sitemap indexing this way. I’ve confirmed the issue using curl -I and also with SiteGround technical support. Please can you advise on a way to disable or override this behavior without deactivating the plugin?

    Thanks in advance — this is affecting both my own site and client sites.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    We apologize for the issue you are facing with the x-robots-tag: noindex header being injected into your sitemap_index.xml file. This can indeed affect indexing behavior, and we appreciate you bringing this to our attention.

    To address this issue, you can try adding a filter in your theme’s functions.php file to override the default behavior. Here’s how you can do it:

    add_filter( 'rank_math/sitemap/enable_caching', '__return_false' );

    This filter disables caching for the sitemap, which may help resolve the issue with the noindex header.

    If this does not resolve the problem, we recommend checking for any plugin conflicts or settings that might be affecting the sitemap. You can also refer to our sitemap issues guide for more troubleshooting steps.

    If you continue to experience difficulties, please reply to this ticket with your site URL, and a human agent from our support team will assist you further. Thank you for your understanding, and we’re here to help!

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    Hi there,

    Thanks for the quick reply.

    I’ve followed your instructions and added the following filter to my theme’s functions.php file:

    add_filter( ‘rank_math/sitemap/enable_caching’, ‘__return_false’ );
    I then purged all caches (SiteGround Optimizer, SiteGround CDN, browser), and re-checked the headers using a curl request:

    curl -I https://www.visionphoto.co.uk/sitemap_index.xml
    Unfortunately, the x-robots-tag: noindex header is still being injected, even with caching disabled.

    The moment I deactivate Rank Math SEO, the noindex header disappears — confirming that the plugin is the source.

    Can you please escalate this to a human support agent?

    This issue is preventing my sitemap from being properly recognized by Google Search Console, and I’d really appreciate a more in-depth look.

    Thanks again,
    Mark
    visionphoto.co.uk

    I’ve reviewed your documentation at https://rankmath.com/kb/fix-sitemap-issues/, and I can’t find any mention of how to remove the x-robots-tag: noindex header. Could you confirm if this is hardcoded by design, and if so, what is the correct method for overriding it permanently?

    Matt
    Rank Math free

    I’m experiencing the exact same issue. I tried adding the filter in my theme and following all the instructions on the sitemap issues page.

    The only thing that has worked is deactivating RankMath. I’m reaching out to support now.

    Just randomly surfing this thread and could see no replies from a real human even after the customer has requested for. I was thinking to subscribe but now holding back that thought. We customers expect a human touch.

    Hello,

    Thank you for contacting Rank Math support, and sorry for the unexpected delays and any inconvenience that might have been caused due to that.

    This is not an issue as XML Sitemaps are designed to be crawled by search engines, not indexed. The X-Robots-Tag: noindex directive ensures that the sitemap itself does not appear in search results, but this does not prevent Google from crawling its contents and indexing the pages listed within it.

    There’s no need to worry, as this is the expected behavior for sitemaps.

    However, if you still wish to remove the noindex tag from your sitemap for any specific reason, you can use the filter in 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 filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Don’t hesitate to get in touch with us if you have any other questions.

    Thanks for the helpful and detailed response — much appreciated.

    I’ve added the rank_math/sitemap/http_headers filter as suggested, and it resolved the issue exactly as intended. The x-robots-tag: noindex header is no longer present on the sitemap, and Google Search Console is now reading the sitemap correctly again.

    Glad to have this sorted, and I appreciate the clear guidance on how to apply the override.

    Thanks again for your support!

    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.

Viewing 8 replies - 1 through 8 (of 8 total)

The ticket ‘x-robots-tag: noindex’ is closed to new replies.