Sitemap Not Indexed – X-Robots-Tag: noindex Issue in Search Console

#1053612
  • Resolved Ahtesham Sheikh
    Rank Math free

    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/

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

    We apologize for the issue you are facing with your sitemaps not being indexed due to the X-Robots-Tag: noindex error. It seems you’ve already taken several steps to troubleshoot this issue, which is great.

    Here are a few additional suggestions that might help resolve the problem:

    1. Check for Custom Code: Since you’ve added custom filters and actions in your functions.php, ensure that there are no conflicting codes elsewhere in your theme or plugins that might be adding the X-Robots-Tag: noindex header back to your sitemaps.

    2. Review .htaccess Rules: Double-check your .htaccess file to ensure that there are no rules that might be inadvertently adding the noindex header to your sitemap URLs.

    3. Plugin Conflicts: Even though you’ve disabled caching plugins, other plugins could still be causing conflicts. You might want to temporarily disable all plugins except Rank Math to see if the issue persists.

    4. Server Configuration: If you have access to server-level configurations, check if there are any settings that might be affecting the headers sent with your sitemap responses.

    5. Use Health Check Plugin: Consider using the Health Check plugin to troubleshoot plugin conflicts without affecting your live site.

    6. Contact Hosting Provider: Sometimes, server configurations set by your hosting provider can lead to unexpected behavior. It may be worth reaching out to them to see if they can identify any issues related to headers being sent with your sitemap responses.

    If none of these solutions work, we recommend replying to this ticket with the details of what you’ve tried, and a human agent from the Rank Math Support team will take over and assist you further.

    Thank you for your patience, and we hope to resolve this issue for you soon!

    Sources:
    How to Fix Submitted URL Marked ‘NoIndex’ Error » Rank Math

    Hello, thank you for the response.

    I have already tried all of the above steps, including:

    Disabling all plugins except Rank Math

    Switching to default theme

    Reviewing and modifying .htaccess

    Adding/removing custom code to filter headers

    Disabling caching (WP Rocket, Cloudflare)

    Re-enabling sitemap module after full reset

    Even tested with Health Check plugin and manual sitemaps

    Despite everything, the sitemap pages still return an X-Robots-Tag: noindex header, which prevents indexing.

    Kindly escalate this issue to a human support agent for a deeper investigation.

    Thank you!

    ✅ Extra Advice (just in case):
    Double-check headers at https://httpstatus.io for:

    /sitemap_index.xml

    /product-sitemap.xml

    /page-sitemap.xml

    Hello,

    Please note that RankMath sets the “noindex” tag on your sitemaps by default. It’s done this way because a sitemap is only meant to guide search engines through your site, not to rank in search results.

    The reason you’re seeing it set to “noindex” is to prevent it from appearing in search results, which is the desired behavior.

    You should follow this guide to properly submit your sitemap:
    https://rankmath.com/kb/submit-sitemap-to-google/

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

    Looking forward to helping 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.

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

The ticket ‘Sitemap Not Indexed – X-Robots-Tag: noindex Issue in Search Console’ is closed to new replies.