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 just wanna convert all links to no follow links which are being displayed in sidebar or footer or comments.

How can i do this?

share|improve this question
up vote 2 down vote accepted

wp_rel_nofollow() does this for you. It is already called on pre_comment_content, so comments should be covered. For sidebars and footers, this depends on the widgets and other code you use there, but it should be possible to call that function there too.

share|improve this answer
is this filter applied by default? or do i need to apply it. – Amit Gupta Oct 20 '10 at 2:42
@articlestack: It is applied to comments (via the pre_comment_content filter) in default-filters.php, so that should be OK. For the sidebars you should do this yourself, unless you use a widget that already does this. – Jan Fabry Oct 20 '10 at 13:36

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.