This post’s title should be “How to remove the evil nofollow tag from comments!” I hope you remember my old posts about “dofollow” tag. This is a tag you add to external links, to show your help to their Page Rank (PR). The more interesting is that to be have a real “dofollow” blog, you have to be “dofollow” in the comments too.
I know, the WordPress blogs structure is “nofollow” by default, to avoid spam, but it’s also avoiding giving a help “hand” to your visitors or the ones you admire. I met people afraid of “dofollow” because they “have been penalized by Google for having “dofollow” links” [sic], which is stupid. They were penalized because they have deliberately used some “black hat” practices, being more or less aware of that. Anyway, this is a proof of deep egotism, as I have said in the past.
Once upon a time, existed a wordpress plugin named Dofollow. I don’t know why, I don’t know how, a few weeks or a few months ago, got deprecated. I mean, its functionality ceased to exist. It says that the plugin functionality was “merged” in the External Links plugin. In a way they are right, every external link you have exposed in your posts are all just “external”, you having the possibility to set them to be rel="external nofollow"
if you want. If you don’t check this cases’ setting, your external links will all be just rel="external"
. Unfortunately, in comments, the rel="external nofollow"
tag reappears because there’s no plugin to remove the "nofollow"
part.
I found a solution for Genesis, one for Thesis and one a little bit more tricky, but applicable for all wordpress sites.
So, if you don’t want to complicate yourself too much, you have to access your core wordpress files in your File Manager, and open wp-includes/comment-template.php for edit and look for the following line:
$return = "$author";
You have to simply delete nofollow and save. You’ll live the line like this:
$return = "$author";
I have modified my locale.php in my Romanian blog, and sometimes, when WordPress updates and upgrades, I have to do that again. So, if you decide to tweak any of your wordpress core files, you have to check from time to time if your comment author links are still just rel="external"
, because when WordPress upgrades from a version to other, the core may be reset, and you have to delete the “nofollow
” bit again.
For Thesis theme users, you can add the following snippet to your functions.php file:
function do_follow_commenters($output) { return str_replace(' rel="nofollow">', '>', $output); } add_filterthesis_avatar', 'do_follow_commenters');
Save, clean the cache, and you’re done.
For Genesis (my favorite, actually, since it’s the framework I use and I’m pushing it to you all) you have to add the following piece of code to the functions.php file:
remove_filter( 'genesis_attr_comment-author-link', 'genesis_attributes_comment_author_link' ); add_filter( 'genesis_attr_comment-author-link', 'ae_genesis_attributes_comment_author_link' ); /** * Remove nofollow on comment author link */ function ae_genesis_attributes_comment_author_link( $attributes ) { $attributes['rel'] = 'external'; $attributes['itemprop'] = 'url'; return $attributes; }
It is really simple. Don’t forget to clean the cache after saving.
I’m not a master blaster coder myself, so I have to thank for these compiled info to Girlie for the Thesis snippet, to Dave Bonds for the Genesis snippet (which I also use here, on this very site) and to Ronda Bowen for the wordpress core modification stuff.
If you liked what you read (and for that I humbly thank you for your patience), subscribe to this blog by Email! Follow this blog on Twitter, on Facebook, and on Google+! For a joyous day, check out my pins on Pinterest or my grams on Instagram 😄. I hope you like this blog so much that you think it’s time to take a step further by becoming yourself a blogger; in order to do that have the kindness to read the Own Your Website offer I have prepared for you! You won’t regret. Thanks for passing by 😄 Speak your mind, don’t be shy!
Copyright © 2014 Rodolfo Grimaldi Blog – The Evil nofollow Is Back in Comments
krish says
Good post. keeps rocking !!
Pauline says
Thank you so much, I have been looking for an answer to the nofollow in comments for days. 🙂 And I totally agree with you, the Genesis is the best thing I did for my site and improved my traffic in days by over 60% and no structured data errors.
Pauline says
Hi it’s me again 🙂 I just checked my site in Chrome to see if the comments now show do follow and it is still showing no follow links in the comments section.
I have the external links plugin activated, would this prevent the code placed in my functions.php to not work?
Daniel Mihai Popescu says
I have it activated too. I think you just have to clear all your browsers’ caches and your website’s as well. Thanks for passing by, Pauline 😃
Hadoop Training Chennai says
Awesome..!!
Daniel Mihai Popescu says
Good 🙂