Disable x-robots-tag: noindex on sitemap_index.xml

#1029267
  • Resolved garderi
    Rank Math free

    Hello Rank Math team,

    I’ve noticed that when Rank Math generates sitemap_index.xml, the HTTP response includes the following header:

    makefile
    Copier
    Modifier
    x-robots-tag: noindex
    This behavior prevents Google Search Console from indexing the sitemap and triggers a “Submitted URL marked ‘noindex’” error.

    I’ve already confirmed:

    The header is not injected by the server (Cloudflare or LiteSpeed)

    Other static .xml files do not return this header

    The issue resolves when Rank Math is disabled

    Forcing a PHP override with header(‘X-Robots-Tag: index, follow’) only works partially, and is not a clean solution

    My questions:
    Why does Rank Math add this noindex header to sitemaps?

    Is there a setting to disable it natively in the plugin?

    If not, is there a filter or action hook I can use to prevent this header from being added?

    Thanks for your help — I’m using Rank Math on a news publication site and want to ensure SEO integrity for all sitemap outputs.

    Best regards,
    Alex Thoney
    actualites.fr

Viewing 1 replies (of 1 total)
  • Hello,

    We apologize for the issue you are facing with the x-robots-tag: noindex header being added to your sitemap_index.xml. Thank you for providing detailed information about your situation.

    Rank Math does not typically add a noindex header to sitemaps unless there is a specific configuration or conflict causing this behavior. Here are some steps you can take to address this issue:

    1. Check Rank Math Settings: Ensure that there are no settings in Rank Math that might be causing this header to be added. You can review the sitemap settings under Rank Math SEO → Sitemap Settings.

    2. Filter to Remove Header: If there is no native setting to disable the noindex header, you can use a filter in your theme’s functions.php file to remove it. Here’s an example of how you might do that:

      add_filter( 'rank_math/sitemap/x_robots_tag', function() {
         return 'index, follow';
      });

      This filter should override the default behavior and set the header to index, follow instead.

    3. Plugin Conflicts: Since you mentioned that the issue resolves when Rank Math is disabled, it may be worth checking for any plugin conflicts. You can use the Health Check plugin to help identify if another plugin is causing this issue.

    4. Contact Support: If the problem persists 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.

    We hope this helps you resolve the issue with your sitemap. Please let us know if you have any further questions or concerns!

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

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

    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 1 replies (of 1 total)

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