0

I am trying to Remove rel="ugc" from links in comments, but nothing is working. I even tried Remove rel="nofollow ugc" from links in comments

I also tried many plugins like: UGC comment, External Link, but nothing is working.

1
  • The solution in that post removes the rel when the comment is displayed in a page, but it will still be visible in the comment as it is stored in de the database. Is that a problem?
    – cjbj
    Apr 7 at 12:28

1 Answer 1

2

The rel=ugc is added by a default filter on pre_comment_content. You can disable this by adding the following line to your functions.php:

remove_filter ('pre_comment_content', 'wp_rel_ugc', 20);

This may not be wise. If at some point you change your mind, you would have to go through all comments to add it. It is problably better to use the solution to which you link. This one lets the filter add rel=ugc when the comment is saved into the database and only removes it every time the comment is displayed on a page.

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.