How to Remove Robots Meta Tag

#361297
  • Resolved Amar Ilindra
    Rank Math free

    Hi team,

    We’re planning to switch to RankMatch Pro from Yoast Premium and currently trying the free version of RankMath on a staging environment.

    Internally, we have a use-case, where we define the robots via headers (X-ROBOTS-TAG) and we remove the “robots” meta tag from the HTML.

    In Yoast, we’re able to do this with the following filters

    add_filter('wpseo_robots', '__return_false');
    add_filter('wpseo_googlebot', '__return_false'); // Yoast SEO 14.x or newer
    add_filter('wpseo_bingbot', '__return_false'); // Yoast SEO 14.x or newer

    Is it possible to do it with RankMath too?

    I already tried “rank_math/frontend/robots” but couldn’t make it work.


    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    return array();
    });

    Thank you.

Viewing 2 replies - 16 through 17 (of 17 total)
  • Can you help me with the pseudo-code or a brief on how it can be done? A little hint helps me develop the code.

    PS: I’m a WordPress plugin developer.

    Nigel
    Rank Math business

    Hello,

    Find a filter that conditionally filters/updates the option value ‘rank-math-options-titles’ and disables post robots meta values. All before the page loads. The option_{$option} hook might help: https://developer.wordpress.org/reference/hooks/option_option/

    Hope that helps.

    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 2 replies - 16 through 17 (of 17 total)

The ticket ‘How to Remove Robots Meta Tag’ is closed to new replies.