Hello,
Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.
The robots meta tags are an integral part of our plugin and can’t be removed completely from the HTML with any filter.
This tag is added as part of our action rank_math/head that is used to generate all the meta tags inside the header.
However, you can unset the attribute value by using this filter:
add_filter( 'rank_math/frontend/robots', function( $robots ) {
return [];
});
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Thank you for your speedy reply!
Your snippet worked but it also removed the “index” value from the robots meta tag and not just noindex. The pages I’ve looked at show this:
<meta name=”robots” content=”max-snippet:-1, max-video-preview:-1, max-image-preview:large”/>
As I correct to assume that “index” is basically default even if not explicitly stated. I did a URL inspection with Google Search and pages that have the above meta robots tag can be indexed.
Thanks again.
Bud
Hello,
Though it should not have issues if the index tag is not present, you can modify the filter a bit to add it. You can try using the below filter and see if that helps:
add_filter( 'rank_math/frontend/robots', function( $robots ) {
if(is_checkout()){
$robots["index"] = 'index';
}
return $robots;
});
Let us know how that goes.
Thank you.
Thank you so much!
That’s just what I need as the script applies only to the checkout page!
Love it!
Bud
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.