WordPress rel=”nofollow ugc” attribute

Function Name: wp_rel_ugc()
Supported Version: WordPress 5.3+

What is rel UGC attribute?
UGC stands for User Generated Content, a rel attribute value recommended for links where the content was generated by user like comments or forum posts and Google made an announcement on Sept 10, 2019 for “ugc” link attribute value support.

In WordPress 5.3, a new function was introduced which help developers add both “nofollow” and “ugc” values to the rel attribute, see sample code below:

$url = '<a href="https://samplewebsite.com/comments/123">user forum comment</a>';
$ugc_url = wp_rel_ugc( $url );
echo $ugc_url;
// output: <a href="https://samplewebsite.com/comments/123" rel="nofollow ugc">user forum comment</a>

2 thoughts on “WordPress rel=”nofollow ugc” attribute”

  1. At this time it looks like BlogEngine is the preferred blogging platform available right now.

    (from what I’ve read) Is that what you’re using on your blog?

  2. Hi there, I wish for to subscribe for this webpage to obtain newest updates, thus where
    can i do it please assist.


This site uses Akismet to reduce spam. Learn how your comment data is processed.