Robots-Tag: noindex problem

#940894
  • Resolved Nacho Quevedo
    Rank Math free

    Estoy experimentando un problema con el Sitemap generado por Rank Math. El encabezado HTTP incluye X-Robots-Tag: noindex (utilizando Web Sniffer), lo que impide que Google Search Console pueda procesar el Sitemap. He intentado:

    Verificar las configuraciones en Titles & Meta y Sitemap Settings.
    Aplicar filtros en functions.php y rank-math.php para forzar la eliminación de noindex.
    Desactivar todos los plugins, y el problema desaparece únicamente al desactivar Rank Math. ¿Podrían ayudarme a identificar por qué se está aplicando esta etiqueta y cómo solucionarlo?

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

    Thank you for contacting Rank Math and bringing your concern to our attention.

    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/

    Also, please follow these steps to flush your sitemap cache:

    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. Disable the transient cache for the sitemap by applying this filter. This will make sure that your XML sitemap always reflects the latest changes on your site:

    /** 
     * Filter if XML sitemap transient cache is enabled.
     *
     * @param boolean $unsigned Enable cache or not, defaults to true
     */
    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');

    If you’re not sure how to add this code, you can follow this guide:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Looking forward to helping you.

    Nacho Quevedo
    Rank Math free

    Thanks for your answer, but:

    With the “noindex” tag, Google Search Console says that “Sitemap could not be read”.
    I´ve tried to implement all the solutions you are giving but it doesn´t work.
    I still has the “X-Robots-Tag: noindex ” in HTTP Response Header of the sitemap, and still the “URL is not available to Google” in Google Search Console.

    Hello,

    The “Sitemap could not be read” is not related to the Noindex as Google can crawl your sitemap even it is set to Noindex.

    We suggest you remove the index.php slug from your sitemap URL and after that, 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/

    Once done, clear your website cache, remove all the submitted sitemap, and resubmit only the /sitemap_index.xml in the Search Console.

    Let us know how it goes. Looking forward to helping you.

    Thank 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 ‘Robots-Tag: noindex problem’ is closed to new replies.