Blogger Comment Link Love

One of the things that has frustrated me about Blogger, and Google to some extent, is the fact that they try to dictate to me how the links should be on my blog. For example comment links are automatically given the “nofollow” attribute. Well I don’t like that. I want the people who take the time to comment to get a link back to their website or blog. That seems fair. I have comment moderation in place so comments have to be approved before being published so I can delete the spammers comments and they won’t get any link love.

I searched through the Blogger help, which is pretty much useless to tell you the honest truth. Then I searched through the Blogger help group, and there were some answers there, but they were all for the new layout system when your blog is hosted on Blogspot. Well that did not help me so I went back to the Blogger help looking for the classic template tags and it was there that I got my idea.

The Blogger template tag <$BlogCommentAuthor$> is the template tag responsible for printing out the comment authors name and link. There is no way of telling it not to output a rel=“nofollow”, so enter in a little snippet of PHP to modify that little bit of HTML that Blogger is inserting into my blog. Look where Blogger has the <$BlogCommentAuthor$> template tag replace it with <?php echo str_replace(' rel="nofollow"', '', '<$BlogCommentAuthor$>'); ?> and presto that nasty little rel=“nofollow” attribute is gone. Of course this only works if you are processing your HTML files as PHP.

On some blog templates you might not find the <$BlogCommentAuthor$> template tag, instead they have <$I18NPostedByCommentAuthor$>. It does exactly the same thing. Just replace that tag with <?php echo str_replace(' rel="nofollow"', '', '<$I18NPostedByCommentAuthor$>'); ?> and let the link love begin.

On a related note, if you leave a comment and want to have a link pointing to your website make sure you choose the “Other” under “Choose an identity”. This way you can specify your website or blog address instead of a Blogger profile. No one needs to have link love to their Blogger profile.

Oh and what is the cost for all of this link love? Unlike some bloggers out there who have decided to charge $10 to remove the nofollow attribute, I will charge you ABSOLUTELY NOTHING! In case you are wondering the above link is a nofollow, because he does not need anymore links.

Categories: blogging   web-programming