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?

1 Answer 1


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"';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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