How to set Noindex to all wordpress pages in a catergory?
As the previous code I posted didnt work for the OP, clutching at straws, we can try to obtain the same outcome using get_the_category As the OP stated he was using YOAST, i’ll wrap this function into the YOAST hook for robots. add_filter(‘wpseo_robots’, ‘yoast_no_home_noindex’, 999); function yoast_no_home_noindex($string= “”) { $term_id = get_the_category( $post->ID ); if($term_id[0]->term_id … Read more