admin管理员组

文章数量:1122832

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.

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.

Share Improve this question edited Apr 7, 2024 at 13:19 cjbj 15k16 gold badges42 silver badges89 bronze badges asked Apr 7, 2024 at 7:24 JimmyJimmy 1 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 Commented Apr 7, 2024 at 12:28
Add a comment  | 

1 Answer 1

Reset to default 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.

本文标签: filtersRemove relquotugcquot from links in comments