X robots tag

#970487
Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    We apologize for the issue you are facing regarding the X-Robots-Tag being set to noindex for your sitemap. The X-Robots-Tag can be configured to control how search engines index and crawl your pages. If it’s set to noindex, it instructs search engines not to index the content of that sitemap.

    There could be several reasons for this setting:

    1. Intentional Configuration: It might have been set intentionally to prevent indexing of certain posts or pages listed in the sitemap.
    2. Plugin Settings: If you are using an SEO plugin like Rank Math, there may be settings that dictate how sitemaps are handled, including whether they should be indexed or not.
    3. Server Configuration: Sometimes, server settings or .htaccess rules can inadvertently affect the X-Robots-Tag settings.

    To resolve this, we recommend checking your SEO plugin settings and any server configurations that might be affecting the sitemap. If you need further assistance, please reply to this ticket with your site URL, and a human agent from the Rank Math Support team will take over and provide more specific help.

    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.

    Uman agent help please

    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.

    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/

    Looking forward to helping you.

    Hi , the strange thing is that Rank Math only sets it on Posts and Tags and this prevented Google Search Console from indexing them. Yesterday by a miracle I saw that it still indexed them. Thank you for the code, but I don’t understand why only those two sitemaps have x-robots-tag: noindex despite having added them.

    Hello,

    Rank Math sets the noindex tag for all sitemaps by default, but search engines can still crawl and use them as intended. If only the Posts and Tags sitemaps have this header, it could be due to another setting or plugin conflict. You might want to check if any custom rules or caching issues are affecting them.

    Don’t hesitate to get in touch with us if you have any other questions.

    Ok Thank you for all

    Hello,

    We are glad that helped.

    Can you please confirm if you still need our assistance with anything else or we can close the ticket?

    Looking forward to hearing back from you.

    Thank you.

    Andrea Bodria
    Rank Math free

    yes

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

You must be logged in to reply to this ticket.