Skip to:
Content

BuddyPress.org

Opened 6 weeks ago

Last modified 6 weeks ago

#8326 new enhancement

Apply UGC attribute for activity links

Reported by: vapvarun Owned by:
Milestone: 7.0.0 Priority: normal
Severity: normal Version: 6.1.0
Component: Activity Keywords: has-patch 2nd-opinion
Cc:

Description

Recently Google has updated its policy for nofollow attributes and they will be considered as hints.

Link attribution can be done in three ways: "nofollow", "sponsored", and "ugc" — each signifying a different meaning. (The fourth way, default, means no value attributed).

Activities are in general user-generated content, we can use UGC instead of nofollow or combination of both attributes.

for example, rel="nofollow ugc" is also valid.

https://buddypress.org/support/topic/how-to-add-ugc-into-outbound-links-rel

Attachments (1)

8326.patch (982 bytes) - added by vapvarun 6 weeks ago.
nofollow with UGC

Download all attachments as: .zip

Change History (4)

@vapvarun
6 weeks ago

nofollow with UGC

#1 @imath
6 weeks ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 7.0.0

Thanks a lot @vapvarun let’s do it!

#2 @imath
6 weeks ago

  • Keywords 2nd-opinion added; commit removed

I just had another look into it, what happens for activities containing links before this patch is applied ? I believe they shouldn't have the ugc rel attribute.

We should probably do str_replace( array( ' rel="nofollow"', " rel='nofollow'", ' rel="nofollow ugc"', " rel='nofollow ugc'"), '', $text ). What do you think?

#3 @vapvarun
6 weeks ago

@imath yes it will be more general scope, I had considered that Nofollow is added using the above filter almost all activities as HTML is not allowed in general unless admins have added with Nofollow manually on purpose.

With the initial approach, it will allow them to keep those links with nofollow only without UGC on which they have added Nofollow manually. eg https://prnt.sc/tbus97

Last edited 6 weeks ago by vapvarun (previous) (diff)
Note: See TracTickets for help on using tickets.