Sitemap showing no index for three sitesSubject: Sitemap X-Robots-Tag: noindex

#1051484
  • Resolved Drew Sainte Marie
    Rank Math free

    Subject: Sitemap X-Robots-Tag: noindex Header Being Set by Rank Math — Requesting Override or Fix

    Hi Rank Math team,

    I’m reaching out for help regarding an SEO indexing issue that appears to be caused by Rank Math’s handling of sitemap headers.

    I manage three websites that all use Rank Math:

    https://www.blackswangondolas.com

    https://howtogrowatourcompany.com

    https://www.drewsaintemarie.com

    Recently, I discovered through both Google Search Console and live header tests (https://httpstatus.io) that all sitemap files for all three sites — including sitemap_index.xml, post-sitemap.xml, and page-sitemap.xml — are being served with the HTTP header:

    makefile
    Copy
    Edit
    X-Robots-Tag: noindex
    This prevents Google from parsing the sitemaps at all and results in errors like:

    ❌ Page cannot be indexed: Excluded by ‘noindex’ tag

    After extensive troubleshooting, I contacted my host (WPX Hosting), and they confirmed that this header is not being injected by the server. Instead, they traced it back to Rank Math — and according to their support team, it appears that Rank Math sets this noindex tag by default on XML files. There are also no conflicting rules that should be not allowing it on our end.

    Why This Matters:
    While sitemaps aren’t meant to rank, Google still needs to crawl and process them, and this header completely prevents that.

    We’re seeing direct negative impact across all three sites — blog impressions dropping to zero, pages not getting indexed, and sitemaps being rejected.

    Our Request:
    We’re looking for any of the following:

    A setting inside Rank Math (even hidden or advanced) to disable the X-Robots-Tag: noindex header for sitemap XML files

    A filter or code snippet we can add in functions.php to override this behavior

    Confirmation on whether this is expected behavior and if so, how to cleanly remove it

    If there’s an update or workaround you can recommend, we’d really appreciate it.

    WPX pointed us to you, and we’re hoping to get this resolved without disabling Rank Math (we’re happy users otherwise!).

    Thanks in advance for your help — and please let us know how to proceed!

    Best regards,
    Drew
    (Owner, Black Swan Gondola / How to Grow a Tour Company / DrewSainteMarie)

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

    We apologize for the issue you are facing with the X-Robots-Tag: noindex header being set on your sitemap files. Thank you for bringing this concern to our attention.

    To address the issue, please check the following:

    1. Sitemap Settings: Ensure that your sitemap settings in Rank Math are configured correctly. You can do this by navigating to Rank Math > Sitemap Settings and verifying that the settings are as intended.

    2. Robots.txt File: Check your robots.txt file to ensure there are no rules that might be affecting the indexing of your sitemaps. You can find this under Rank Math > General Settings > Robots.txt.

    3. Custom Code: If you need to override the default behavior, you can add a filter in your theme’s functions.php file. Here’s a code snippet you can use:

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

      This will disable caching for your sitemap, which may help in resolving the issue.

    4. Contact Support: If the above steps do not resolve the issue, we recommend replying to your ticket with this information, and a human agent from our support team will assist you further. They can provide more specific guidance or investigate if there is a deeper issue at play.

    If you have any further questions or need additional assistance, please feel free to reply to this ticket. We’re here to help!

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

    Hi Rank Math team,

    I added the recommended filter to functions.php as directed:

    php
    Copy
    Edit
    add_filter( ‘rank_math/sitemap/enable_caching’, ‘__return_false’ );
    I confirmed:

    It’s in the active theme

    It’s at the top of the file

    All caches are cleared

    But after testing via https://httpstatus.io, the sitemap at:

    arduino
    Copy
    Edit
    https://www.blackswangondolas.com/sitemap_index.xml
    …is still being served with:

    makefile
    Copy
    Edit
    x-robots-tag: noindex
    Can you confirm if this filter disables that header? Or is there another method to fully remove it so Google can properly index my sitemap?

    **so when i wrote my initial message to RankMath it was affecting three of my sites… your suggested fix, fixed one of my sites but weirdly enough it didn’t work for drewsaintemarie.com or blackswangondolas.com

    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 showing no index for three sitesSubject: Sitemap X-Robots-Tag: noindex’ is closed to new replies.