Skip to:

Opened 11 months ago

Closed 7 months ago

#8326 closed enhancement (fixed)

Apply UGC attribute for activity links

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


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.

Attachments (1)

8326.patch (982 bytes) - added by vapvarun 11 months ago.
nofollow with UGC

Download all attachments as: .zip

Change History (9)

11 months ago

nofollow with UGC

#1 @imath
11 months 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
11 months 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
11 months 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

Last edited 11 months ago by vapvarun (previous) (diff)

#4 @imath
8 months ago

@vapvarun I'm now wondering: should we only add this ugc attributes for the activity_update activity type ? Or should it be all activity type, some activity types, if so which ones ?

#5 @vapvarun
8 months ago

@imath, we can go with all activities in general terms. All activities are UGC, whether it's a specific activity type or added by any user role.

This ticket was mentioned in Slack in #buddypress by imath. View the logs.

8 months ago

This ticket was mentioned in Slack in #buddypress by imath. View the logs.

7 months ago

#8 @imath
7 months ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 12756:

Activity: adds the ugc rel attribute to activity item links

Props vapvarun

Fixes #8326

Note: See TracTickets for help on using tickets.