Notifications
Clear all

Script [Solved] How to Disable About Me and website from user profile ?

9 Posts
3 Users
1 Likes
2,823 Views
Posts: 18
Topic starter
(@azzidoqsc)
Eminent Member
Joined: 3 years ago

Hi there,

Due to many spam users I want to disable About Me and website. I tried the code suggested here: https://wpforo.com/community/how-to-and-troubleshooting-2/way-to-disable-website-and-about-me-column-in-account/

but it does not work.

Example of scam page: https://www.laptopu.ro/community/profile/zpmmillie587579/

8 Replies
Posts: 18
Topic starter
(@azzidoqsc)
Eminent Member
Joined: 3 years ago

Any idea ?

Usually scam users put stuff into About Me and Website Link. I want to remove these 2 from user profile.

Please guide me. Really appreciate 🙂

4 Replies
Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1266

@azzidoqsc

try this code

function wpforo_custom_remove_user_fields( $fields ){
$remove_fields = array('about', 'site');
if( !empty($fields) ){
foreach( $fields as $r => $rows ){
foreach( $rows as $c => $cols ){
foreach( $cols as $f => $field ){
if( $field && in_array($field, $remove_fields) ){
unset($fields[$r][$c][$f]);
}
}
}
}
}
return $fields;
}
add_filter( 'wpforo_get_account_fields', 'wpforo_custom_remove_user_fields');
(@azzidoqsc)
Joined: 3 years ago

Eminent Member
Posts: 18

@tutrix

It does not work 🙁

I still can see About Me page.

Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10503

@azzidoqsc,

This code disables the About and Site fields in the My Profile > Account page. This doesn't have any affection on the profile home page.

(@azzidoqsc)
Joined: 3 years ago

Eminent Member
Posts: 18

@robert

Got it. Well done as usual.

Posts: 18
Topic starter
(@azzidoqsc)
Eminent Member
Joined: 3 years ago
2 Replies
Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1266

@azzidoqsc

the code above normally removes the fields from the "Account Tab" so that nobody can insert anything anymore

you can also hide the fields in the "Profile Tab"

add this to custom css

About

#wpforo #wpforo-wrap .wpforo-profile-wrap .wpforo-profile-home .wpf-field.wpf-field-name-about {
display: none;
}

Website

#wpforo #wpforo-wrap .wpforo-profile-wrap .wpforo-profile-home .wpf-field.wpf-field-name-site {
display: none;
}

Dashboard > Forums > Settings > Style (custom css)

 

(@azzidoqsc)
Joined: 3 years ago

Eminent Member
Posts: 18

@tutrix

Great. Thanks a lot.

P.S. You have a nice customized forum.