Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.
You can easily do that from the product list with Rank Math PRO. Here’s a link for more information:
https://rankmath.com/kb/bulk-editing-in-rank-math/#num-3-3-set-to-noindex-pro
Here’s a screencast for your reference using Rank Math PRO:
https://i.rankmath.com/n2mnan
However, here’s a filter you can try to achieve that on your products under a category:
/**
* Filter to set noindex to specific categories
*/
add_filter( 'rank_math/frontend/robots', function ( $robots ) {
$slugs = array();
$product_cats = wp_get_post_terms( get_the_ID(), 'product_cat' );
foreach ($product_cats as $product_cat){
$slugs[] = $product_cat->slug;
}
if ( in_array( 'category2', $slugs ) ) {
unset( $robots['index'] );
$robots['noindex'] = 'noindex';
}
return $robots;
} );
Update the category2 to your actual product category slug.
I hope that helps.
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.