I want to put noindex atribute on category pages. With other words, I need the category indexed, but category/page-1 with no index.
I want to put noindex atribute on category pages. With other words, I need the category indexed, but category/page-1 with no index.
try it with this in your theme's functions:
add_action('wp_head', 'add_meta_paged_category_pages');
function add_meta_paged_category_pages(){
if(is_category() && is_paged()) {
echo '<meta name="robots" content="noindex, follow">';
}
}Thank you for your reply.
I put it and got this error: Parse error: syntax error, unexpected T_FUNCTION, expecting T_STRING or T_VARIABLE or '$' in http://....
That's strange, if I use it I get no errors.
Can you post the content of your functions.php (with my code in it) here. See the Forum Rules on how to post code.
I just had to put a ; somewhere. Now is working like perfectly.
Thank you a lot for your help!
You must log in to post.