Comments: Add rel="nofollow ugc" attribute to links in comments.

UGC stands for User Generated Content, and the `ugc` attribute value is recommended for links within user generated content, such as comments and forum posts.

See https://webmasters.googleblog.com/2019/09/evolving-nofollow-new-ways-to-identify.html.

Props audrasjb, joostdevalk, dkarfa, SergeyBiryukov.
Fixes #48022.
Built from https://develop.svn.wordpress.org/trunk@46349


git-svn-id: http://core.svn.wordpress.org/trunk@46148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2019-09-30 01:30:58 +00:00
parent 8cb7c5c764
commit 2afdc64723
4 changed files with 72 additions and 32 deletions

View File

@@ -224,7 +224,7 @@ function get_comment_author_link( $comment_ID = 0 ) {
if ( empty( $url ) || 'http://' == $url ) {
$return = $author;
} else {
$return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
$return = "<a href='$url' rel='external nofollow ugc' class='url'>$author</a>";
}
/**