How can I set no index to all entries in portfolio instead of going one by one with RankMath?
Thanks.
Hey peterolle,
Try adding this code to the end of your functions.php file in Appearance > Editor:
function add_custom_meta(){
if (is_singular('portfolio')){
?>
<meta name='bingbot' content='NOODP NOARCHIVE, NOINDEX'>
<meta name='ROBOTS' content='NOINDEX, NOARCHIVE, NOODP, NOYDIR'>
<meta name='GOOGLEBOT' content='NOINDEX, NOARCHIVE, NOODP'>
<?php
} else {}
}
add_action('wp_head', 'add_custom_meta', 1);
Best regards,
Mike
I just check and they still appear.
How can I remove completely portfolio items from Google?
Thanks.
Hi,
If the code is working correctly and you can see the code in your header, then ask Google to recrawl your site.
Best regards,
Mike
Thank you.
The code appears in header when I see a portfolio item, however it is still appearing in google results.
Index Coverage – Last updated: 5/12/20
It appears exactly as this:
<meta name="bingbot" content="NOODP NOARCHIVE, NOINDEX">
<meta name="ROBOTS" content="NOINDEX, NOARCHIVE, NOODP, NOYDIR">
<meta name="GOOGLEBOT" content="NOINDEX, NOARCHIVE, NOODP">
I removed this and tried Rank Math global option. Will wait to see the results.
Thanks.