05 May 2010

Adding nofollow attribute to the link to comments generated through wordpress comments_popup_link

Web Design, Development Tips & Tutorials 1 Comment

If you are using the template tag comments_popup_link to display the link to post comments or open up comments pop up window, you would like to make those links “Nofollow”.  Below is a simple function attached to a WordPress filter to make comment links “Nofollow”. Add the code at the bottom of your WordPress theme functions.php.

<?php function add_nofollow_to_comments_popup_link(){
 return ' rel="nofollow" ';}
add_filter( 'comments_popup_link_attributes', 'add_nofollow_to_comments_popup_link' ); ?>

One Response to “Adding nofollow attribute to the link to comments generated through wordpress comments_popup_link”

Leave a Reply

Web Design Nairobi,Kenya Website Design, Website Design Kenya,Nairobi Website Design