Skip to:
Content

bbPress.org

Opened 9 years ago

Closed 7 years ago

Last modified 2 weeks ago

#2854 closed idea (fixed)

Add rel=nofollow to any links in the bbPress forum profile description

Reported by: robkk's profile Robkk Owned by: netweb's profile netweb
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.2
Component: Component - Users Keywords: has-patch
Cc:

Description

Spammers put their links in the forum profiles description area.

I know you cannot paste urls in the description area directly and it will not turn into a link, but you can still use html to insert a link that way.

We should just deprive any SEO benefit from spammers/spam bots that are smart enough to insert a link using html in the description area.

Attachments (4)

2854.diff (608 bytes) - added by Robkk 9 years ago.
Just added add_filter( 'bbp_get_displayed_user_field', 'bbp_rel_nofollow' ); to the filters.php file
2854-2.patch (677 bytes) - added by Robkk 9 years ago.
2854-3.patch (569 bytes) - added by Robkk 8 years ago.
Just went the simple route.
2854-4.patch (573 bytes) - added by Robkk 8 years ago.

Download all attachments as: .zip

Change History (13)

#1 @Robkk
9 years ago

Code snippet or core??

I have something like this that would basically add nofollow to any links to the users description.

function bbp_user_description() {
$user_id = bbp_get_user_id();   
$description = get_the_author_meta('description', $user_id );
$string = str_replace('href','rel="nofollow" href', $description);
  echo $string;
}

Then I can copy user-profile.php from the bbPress templates into my child theme and replace this.

<?php if ( bbp_get_displayed_user_field( 'description' ) ) : ?>

	<p class="bbp-user-description"><?php bbp_displayed_user_field( 'description' ); ?></p>

<?php endif; ?>

with this

<?php if ( bbp_get_displayed_user_field( 'description' ) ) : ?>

	<p class="bbp-user-description"><?php bbp_user_description(); ?></p>

<?php endif; ?>

#2 @espellcaste
9 years ago

+1 Really good!

@Robkk
9 years ago

Just added add_filter( 'bbp_get_displayed_user_field', 'bbp_rel_nofollow' ); to the filters.php file

#3 @Robkk
9 years ago

  • Keywords has-patch added

Didn't know it was that easy before. WIth the above patch it is also possible to show the users website or other profile fields on their profile page with no problems.

Related: 2570

Version 0, edited 9 years ago by Robkk (next)

@Robkk
9 years ago

#4 @tharsheblows
9 years ago

I think this would be good, too!

#5 follow-up: @Robkk
9 years ago

Here is an example of what I am talking about.

This spammer posted about 15 links on his bbpress.org profile.

https://cldup.com/XkQKiC8DHS.jpg

#6 in reply to: ↑ 5 @netweb
9 years ago

Replying to Robkk:

Here is an example of what I am talking about.

This spammer posted about 15 links on his bbpress.org profile.

Thanks, I've removed all these from the users profile.

@Robkk
8 years ago

Just went the simple route.

@Robkk
8 years ago

#7 @thebrandonallen
8 years ago

  • Keywords has-patch removed
  • Milestone changed from Awaiting Review to Under Consideration

#8 @netweb
7 years ago

  • Component changed from General to Component - Users
  • Keywords has-patch added; 2nd-opinion removed
  • Milestone changed from Under Consideration to 2.6
  • Version changed from 2.5.8 to 2.2

#9 @netweb
7 years ago

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

In 6355:

Users: Use bbp_rel_nofollow() for users profile description in user-profile.php template.

This changeset will help curb spammers taking advantage of posting URLs in their user profile descriptions.

Props Robkk.
Fixes #2854.

Note: See TracTickets for help on using tickets.