Hi,
How can I make the links inside a post to rel="nofollow", but for posts of a one/some category?
Thanks,
Hi,
How can I make the links inside a post to rel="nofollow", but for posts of a one/some category?
Thanks,
You could add the following to your theme's functions.php (if it lacks one you can add it; make sure the first line of the file is <?php and the last is ?>). Edit 1 in in_category(1) to the category ID # you want it to work on:
function nofollow_cat_posts($text) {
global $post;
if( in_category(1) ) {
$text = stripslashes(wp_rel_nofollow($text));
}
return $text;
}
add_filter('the_content', 'nofollow_cat_posts');Done .... Thanks Kafkaesqui :)
I've recently developed a plugin called "Nofollow Links in Posts".
Basically the plugin enables you to add nofollow into links in posts within a specified categories. It also allows you to filter only links in posts older than "X" days to be added with the nofollow attribute.
Hope this helps ;)
You must log in to post.