X-Robots-Tag: noindex header on sitemap despite .htaccess forcing index

#1083432
  • Subject: X-Robots-Tag: noindex header on sitemap despite .htaccess forcing index

    Hi Hostinger support,

    My site nomadwallets.com has a sitemap (https://nomadwallets.com/post-sitemap.xml) returning X-Robots-Tag: noindex in the HTTP headers. This is blocking Google from indexing the sitemap.

    Details:

    “Discourage search engines” in WordPress is OFF.

    .htaccess explicitly sets index, follow for all sitemap XML files:

    <IfModule mod_headers.c>
    <FilesMatch “.*sitemap.*\.xml$”>
    Header unset X-Robots-Tag
    Header set X-Robots-Tag “index, follow”
    </FilesMatch>
    </IfModule>

    Even with all plugins deactivated except Rank Math, the noindex header remains.

    This suggests that the header is being added at the server level (possibly by LiteSpeed or another Hostinger config) before .htaccess takes effect.

    Can you please check if LiteSpeed or server rules in my hosting environment are injecting X-Robots-Tag: noindex for sitemap URLs and remove it?

    Here’s the header output from curl -I for reference:

    [curl -I https://nomadwallets.com/post-sitemap.xml
    HTTP/1.1 200 OK
    Connection: Keep-Alive
    Keep-Alive: timeout=5, max=100
    x-powered-by: PHP/8.2.27
    x-robots-tag: noindex
    content-type: text/xml; charset=UTF-8
    pragma: public
    cache-control: no-cache, no-store, must-revalidate, max-age=0
    expires: 0
    platform: hostinger
    panel: hpanel
    content-security-policy: upgrade-insecure-requests
    strict-transport-security: max-age=31536000; includeSubDomains; preload
    x-frame-options: SAMEORIGIN
    x-content-type-options: nosniff
    referrer-policy: strict-origin-when-cross-origin
    permissions-policy: geolocation=(), microphone=(), camera=()
    x-litespeed-tag: f51_
    date: Tue, 12 Aug 2025 19:29:28 GMT
    server: LiteSpeed
    x-qc-pop: AS-IN-DEL-59
    alt-svc: h3=”:443″; ma=2592000, h3-29=”:443″; ma=2592000, h3-Q050=”:443″; ma=2592000, h3-Q046=”:443″; ma=2592000, h3-Q043=”:443″; ma=2592000, quic=”:443″; ma=2592000; v=”43,46″]

    Thanks,
    [Tushar]

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 on your sitemap. It seems that despite your .htaccess configuration, the noindex directive is still being applied, which is preventing Google from indexing your sitemap.

    From your description, it appears that the header might be set at the server level, possibly by LiteSpeed or another configuration in your hosting environment. Since you have already deactivated all plugins except Rank Math and the issue persists, it would be best to investigate further with your hosting provider.

    To resolve this, we recommend reaching out to Hostinger support directly, as they will have access to the server settings and can check if there are any rules in place that are injecting the X-Robots-Tag: noindex for your sitemap URLs. They should be able to assist you in removing it.

    If you need further assistance with Rank Math settings or configurations, feel free to reply to this ticket, and a human agent from our support team will take over and help you out.

    Thank you for raising this concern!

    This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.

    Hello Rank Math Support,

    I’ve found that when Rank Math is active, my sitemap URLs return an X-Robots-Tag: noindex header, causing search engines to not index my sitemaps. When I deactivate Rank Math, the header disappears.

    I have already checked:

    The “Discourage search engines” setting in WordPress Reading settings is OFF.

    All sitemap and indexing options in Rank Math are set to allow indexing.

    No custom code adds the noindex header.

    I contacted my hosting provider, and they confirmed there is no problem or configuration from their side causing this header.

    Could you please help me identify why Rank Math is adding this header and how to remove it?

    Thanks!

    Hello,

    Thank you so much for getting in touch.

    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.

    Please avoid submitting your XML sitemaps to Google Search Console’s URL Inspection tool, as that tool is meant for HTML pages.

    You can properly submit your sitemap to your Google Search Console account by following this guide: https://rankmath.com/kb/submit-sitemap-to-google/

    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/

    Hope that helps.

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

You must be logged in to reply to this ticket.