-
Hello Rank Match,
Would you be so kind as to give me a solution to this problem?
I want to remove the code from the image from the header.
I already read all your documentation, but this is what I can’t find, what should I add in functions.php?
What I want to delete:
<meta name = “robots” content = “follow, index, max-snippet: -1, max-video-preview: -1, max-image-preview: large”>
-
Hello,
Thank you for contacting Rank Math, and sorry for any inconvenience caused.
You should be able to remove Advanced Robots Meta from Rank Math > Titles & Meta > Advanced Robots Meta and untick what you don’t want to be displayed.
However, the follow and index will still be shown as it is a default from Rank Math to generate it.
To remove then, use this code at the bottom of your theme’s functions.php:
/** * Rank Math: filter the robots meta data. * * @param array $robots The meta robots directives. */ add_filter( 'rank_math/frontend/robots', function( $robots ) { unset( $robots['index'] ); unset( $robots['follow'] ); return $robots; });
You can see the code here:
https://rankmath.com/kb/filters-hooks-api-developer/#change-robots-metaI hope this helps you with your issue. Let us know if you need anything else.
Hi,
What I am looking for is that this meta tag does not appear, nothing appears, that is, not even the goal.
Use your code and try to customize it, however the goal still appears and there are 3 fields that appear.
Please if you are kind enough to specify the code so that the meta does not appear radically.
I use this code:add_filter( ‘rank_math/frontend/robots’, function( $robots ) {
unset( $robots[‘index’] );
unset( $robots[‘follow’] );
unset( $robots[‘max-snippet’] );
unset( $robots[‘max-video-preview’] );
unset( $robots[‘max-image-preview’] );
return $robots;
});But it keeps appearing to me:
<meta name=”robots” content=”max-snippet:-1, max-video-preview:-1, max-image-preview:large”>If I comment at night, please remember to check the ticket that remains unresolved.
Hello,
1) Please go to Advanced Robots Meta from Rank Math > Titles & Meta > Global Meta > Advanced Robots Meta and untick them at it will remove the robots meta from your source code. https://i.rankmath.com/ikOyn0
2) Go to your posts/pages and untick them here.
https://i.rankmath.com/ToJ64dPlease see the screencast. Doing those steps allowed me to removed the robots meta from my source code: https://i.rankmath.com/gcboqc
I hope this helps you with your issue.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hi,
As you can see in the image, that option does not appear in its plugin.
Nor does it appear for individual entries (I have gutenberk disabled) I use the old editor.
How do I do it then to remove the missing tags?
https://ibb.co/zsvSzGkHello,
Thank you for the follow up.
You can remove all the date added by Rank math to your page header by adding th following to your theme functions.php:
add_action( 'wp_head', function(){ remove_all_actions( 'rank_math/head' ); }, 1 );
Let us know if this helps.
With all due respect, I don’t think it’s right for you to give that solution.
Other rank math users can read it and think that it is the correct one, but no, with that they will penalize any website, it will have no meta title, no description, no schema or anything.Hello,
We are sorry for any confusion. The code Michael provides removes all the meta tags added by Rank Math, not just robots meta tags.
Unfortunately, we do not offer an option to remove the entire robots meta tag because that is a core part of an SEO plugin. However, you can use the code that Danial offered and then also disable the max snippet/Max Video Preview/Max Image Preview from relevant tabs in WordPress Dashboard > Rank Math > Titles & Meta like this:
https://i.rankmath.com/b0NCjOThen the code we offered will remove the entire robots meta tag.
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.
The ticket ‘Remove Meta name robots all’ is closed to new replies.