WordPress rel=”nofollow ugc” attribute

wordpress rel no follow

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>

Stay in the loop with our web development newsletter - no spam, just juicy updates! Join us now. Join our web development newsletter to stay updated on the latest industry news, trends, and tips. No spam, just juicy updates delivered straight to your inbox. Don't miss out - sign up now!

We’ve tried our best to explain everything thoroughly, even though there’s so much information out there. If you found our writing helpful, we’d really appreciate it if you could buy us a coffee as a token of support.

Also, if you’re interested in learning more about WordPress, Javascript, HTML, CSS, and programming in general, you can subscribe to our MailChimp for some extra insights.

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.