WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to find a way to add rel="nofollow" to my comments pagination links.
Can anyone provide me with a hook or way to do so?

share|improve this question
up vote 4 down vote accepted

There are two special filters for that:

add_filter( 'previous_comments_link_attributes', 'wpse_77217_comment_nofollow' );
add_filter( 'next_comments_link_attributes', 'wpse_77217_comment_nofollow' );

function wpse_77217_comment_nofollow()
    return ' rel="nofollow"';
share|improve this answer
worked! thank you so much – Ayaz Malik Dec 26 '12 at 4:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.