16
Mar
Add Nofollow Links To Selected Posts
Specifically old paid posts that you think are or may affect your Google Pagerank.
I’m only writing this because it took me ages to find the answer yesterday, and it’s remarkably simple (although only if you use WordPress) so I thought I’d summarise the method I found in the WP.org support forums.
If you don’t know what I’m talking about yet, don’t worry, move on to the next post or hit the question mark on the right for a random trip through my archives. But if you’re a WP user who’s lost page rank through writing paid posts, and you’d like to add ‘nofollow‘ to all the links in a hope of getting it back this is for you.
The Problem
- Adding nofollow to all the links from dozens or hundreds of paid posts would take you hours.
- You could just delete all of the posts, but that isn’t quick either.
- Plus you probably get some search engine traffic for those paid posts.
The Solution
- In your WP dashboard, navigate to ‘Manage’, then ‘Categories’.
- No matter their name, all of your categories will have a number against it. Note the number of your paid category. (f you saved them all under different ones, you could be in trouble).
- Open up your ‘functions.php’ file from your theme folder with a text editor (not a word processor!).
- Under the first <php line, paste the following text, replacing the ‘X’ in ‘in_category(X) ‘ with the number of your paid category.
function nofollow_cat_posts($text) {
global $post;
if( in_category(X) ) {
$text = stripslashes(wp_rel_nofollow($text));
}
return $text;
}
add_filter(’the_content’, ‘nofollow_cat_posts’);
Save the changes, upload to your webspace overwriting the original functions.php in your theme folder and you’re done.
Now all links in any posts filed under your paid category will be ‘nofollow‘ and Google may restore your pagerank. Just be more careful in future ![]()
Readers who viewed this page, also viewed:



