Sitemap xml not getting indexed – x-robots-tag: noindex header

#1087221
  • Resolved Paul
    Rank Math free

    Hello,

    I am experiencing a critical issue where all of my .xml sitemap files are being served with an x-robots-tag: noindex HTTP header. This is causing Google Search Console to reject my sitemap.

    I have performed extensive troubleshooting to isolate the cause, and the issue is not originating from my server. Here is a summary of the steps I have taken:

    I have manually inspected my root .htaccess file. It contains only the standard WordPress rules and nothing that would add this header.

    I have manually inspected my theme’s functions.php file (both the Blocksy child and parent themes). Neither file contains any code that adds an X-Robots-Tag header.

    Given this comprehensive evidence, the header must be originating from RankMath since the sitemap is handled and generated by Rankmath plugin. Latest version is being installed currently and LiteSpeed Cache is not installed.

    This is urgent and request your immediate support.

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

    We apologize for the issue you are facing with your sitemap not getting indexed due to the x-robots-tag: noindex header. It sounds like you’ve done a thorough job troubleshooting the problem.

    To address this issue, we recommend checking the following:

    1. Exclude Sitemap from Caching: Ensure that your sitemap is not being cached. You can follow our tutorial on how to exclude sitemaps from caching.

    2. Check for Security Plugins: Sometimes, security plugins can add headers that may interfere with your sitemap. If you have any security plugins installed, try temporarily disabling them to see if that resolves the issue.

    3. Add Filter to Theme’s rank-math.php File: If the above solutions do not work, you can add a filter to your theme’s rank-math.php file to disable caching for the sitemap. Here’s how:

      • Navigate to WordPress Dashboard → Tools → Theme File Editor (Block Editor) or WordPress Dashboard → Appearance → Theme File Editor (Classic Editor).
      • Select the rank-math.php file and add the following code:
        add_filter( 'rank_math/sitemap/enable_caching', '__return_false' );
      • Click on the Update button to save your changes.
    4. Clear Cache: After making changes, ensure you clear your website cache and check the sitemap again.

    If you continue to experience issues after trying these steps, please reply to this ticket with your site URL so that a human agent from our support team can assist you further. Thank you for your patience, and we’re here to help you resolve this as quickly as possible!

    Sources:
    How to Fix "Incorrect HTTP Header Content-Type" Error in Sitemaps » Rank Math

    Paul
    Rank Math free

    I tried and followed step 1 Exclude Sitemap from Caching, Step 2 Check for Security Plugins, Step 3 – There is no rank-math.php file in my Theme Editor and Step 4 Clear Cache as mentioned and the issue still persists. The response headers data from httpstatus.io still shows x-robots-tag: noindex for our sitemap url (https://anchorhealthpharmacy.com/sitemap_index.xml) and GSC is not able to index the sitemap since ‘noindex’ detected in ‘X-Robots-Tag’ http header.

    Hello,

    Thank you for contacting us. We apologize for any inconvenience that may have been caused.

    We checked the sitemaps. They are opening and validating fine.

    Please try to follow the steps below and see if that works for you.

    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    3. If the above steps don’t seem to work, kindly apply the following filter to your site.

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

    Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Once done, clear your website cache, remove all the submitted sitemaps, and resubmit only the index sitemap in the Search Console.

    Meanwhile, you shouldn’t be worried about the “No: “noindex” detected in the HTTP header “X-Robots-Tag” error, as it’s completely fine and normal to have noindex tag on your sitemap URLs.

    Because, by default, sitemap URLs are set to noindex as it is not meant to be indexed and appear in the search results. The sitemap should only be submitted in the sitemaps section in the Search Console.

    The reason is that we don’t want Google to index the sitemap itself; we only want Google to index the pages and posts that are listed on the sitemap. The sitemap is simply a way to inform Google about the pages and posts on your website, not a page that you want to appear in search results.

    Do not hesitate to let us know if you need our assistance with anything else.

    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 xml not getting indexed – x-robots-tag: noindex header’ is closed to new replies.