DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

By default, WordPress automatically converts all links from the post content to nofollow. If you prefer your links to be dofollow, just read and use the following recipe.

Copy the following code, and paste it on the functions.php file from your theme. Once you saved the file file, the rel=”nofollow” attributes will be removed.

function remove_nofollow($string) {
	$string = str_ireplace(' rel="nofollow"', '', $string);
	return $string;
add_filter('the_content', 'remove_nofollow');

Thanks to Jeff Starr for this awesome piece of code. Have you checked out the book Jeff wrote with Chris Coyier? It’s called Digging into WordPress and it is great!



  1. A bit confused. WordPress doesn’t use nofollow in post content only comments. Was there a change?

  2. I added this code to fundtions.php, but the nofollows remain and continue to get added to new posts. Does it need to be in a certain location in functions.php? Is it supposed to remove from old posts, or just not add to new posts?

    Thanks for any help.


  3. Thank alot. This is very useful and just what i was locking for, for my SEO.
    I will add this to my wordpress blog... :)

Leave a Comment

Your email address will not be published. Required fields are marked *