Make WordPress Core

Opened 15 years ago

Closed 9 years ago

#11359 closed enhancement (wontfix)

Don't nofollow links in admin comments

Reported by: caesarsgrunt's profile caesarsgrunt Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Comments Keywords: gsoc has-patch needs-testing close
Focuses: Cc:


Links in admin comments shouldn't have rel=nofollow.

Admin comments are not user-generated content, and the site owner (admin) is vouching for the links just like when they link from the post itself.

Therefore, this usage of nofollow is incorrect.

Also, if I go and edit a comment and remove nofollow from a link, WP adds it back. It shouldn't do that either.

Note that in the unlikely event of wanting a link in a comment to be nofollowed, this could still be done manually.

Attachments (4)

11359.diff (9.7 KB) - added by akibjorklund 10 years ago.
Do not rel=nofollow links from authors that can edit_comment
11359.2.diff (9.7 KB) - added by akibjorklund 10 years ago.
Fix a bug in the previous patch that would result into an empty comment.
11359.3.diff (10.0 KB) - added by akibjorklund 9 years ago.
Refreshed patch
11359.4.diff (10.0 KB) - added by akibjorklund 9 years ago.
Fix bug that results into admin comment content links inappropriately nofollowed

Download all attachments as: .zip

Change History (18)

#1 @caesarsgrunt
15 years ago

See also #11360(Don't nofollow links within the site).

#2 @caesarsgrunt
15 years ago

  • Version changed from 2.9 to 3.0

#3 @caesarsgrunt
15 years ago

  • Milestone set to 3.0
  • Version changed from 3.0 to 2.9

#4 @hakre
15 years ago


add_filter( 'pre_comment_content',  'wp_rel_nofollow',              15    );

from: file wp-includes/default-filters.php line 158.

wp_rel_nofollow() is in wp-includes/formatting.php line 1373.

A fix could be to remove the original filter, add and own as proxy and then check for the comments author. The problem is, that this filter knows nothing about the actual comment. Only the comment text and that's it. Those information can be passed as additional parameter when applying the filter. see wp_filter_comment().

#5 @hakre
15 years ago

I remember that we had a related problem years ago while comment stati where checked / filtered. I think we should pass the actual comment object to those filters as well which will plugin authors enable to differ (and even core functions enable to differ here).

#6 follow-up: @nacin
14 years ago

  • Milestone changed from 3.0 to Future Release
  • Type changed from defect (bug) to enhancement

#7 @wojtek.szkutnik
14 years ago

  • Keywords gsoc added

#8 @mrmist
14 years ago

Related #10550

#9 in reply to: ↑ 6 @Everfluxx
13 years ago

  • Cc Everfluxx added
  • Version changed from 2.9 to 3.1

Replying to nacin:

Still outstanding in 3.1: current version also adds a "rel=external nofollow" attribute to all author URI links, regardless whether the author URI is actually external.

The rel="external" attribute indicates that the referenced document is not part of the same web site as the current document. (

I wrote an open letter to Matt Mullenweg about the default nofollow on admin links issue ( and Matt replied to me via email, saying that (I'm quoting his words here):

People are free to modify WP's default behaviour through plugins, of which there are many in our official directory. I think the current behaviour is the best as default based on our own experience and advice from Google when nofollow was introduced.

Still, Matt did note provide further details as to why he thinks that the current behavior is "the best as default", and did not answer my questions:

How can nofollowing editorial links help combat link spam? How can that benefit users, or search engines?

So, if he didn't change his mind, I didn't change mine, either.

Therefore, I propose to implement the following behavior as default in WordPress:

Automatically add the "rel=nofollow" attribute to all links in comments, except those posted or edited by users with "edit_comment" capability.

Since I'm not familiar with the discussion, submission and review process for core updates, any pointers or advice would be greatly appreciated. I'm willing to post this to the wp-hackers mailing list and get feedback from other developers and users if deemed necessary. Last but not least, I am willing to contribute a patch for this enhancement.

Version 7, edited 13 years ago by Everfluxx (previous) (next) (diff)

#10 @solarissmoke
13 years ago

  • Version changed from 3.1 to 2.9

Please don't change the Version - it represents the time the bug was first reported, not whether it still exists in the current version.

10 years ago

Do not rel=nofollow links from authors that can edit_comment

#11 @akibjorklund
10 years ago

  • Keywords has-patch added; needs-patch removed

10 years ago

Fix a bug in the previous patch that would result into an empty comment.

#12 @akibjorklund
10 years ago

  • Keywords needs-testing added

9 years ago

Refreshed patch

9 years ago

Fix bug that results into admin comment content links inappropriately nofollowed

#13 @akibjorklund
9 years ago

  • Keywords close added

After discussing with Konstantin Obenland we came to the conclusion that this feature is plugin territory. It can be achieved by creating a plugin, though it might not be straightforward to develop. However, separate bugs should be opened for example for missing filters.

#14 @wonderboymusic
9 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.