Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to disable Gravatar completely?

Hi @BuddyPresser !
I have found out another way get it not editing core files. Put this filter into your functions.php file:

`function bp_remove_gravatar ($image, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir) {

$default = ‘http://yoursite.net/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg’;

if( $image && strpos( $image, “gravatar.com” ) ){

return ‘avatar‘;
}else
return $image;

}
add_filter(‘bp_core_fetch_avatar’, ‘bp_remove_gravatar’, 1, 9 );

function remove_gravatar ($avatar, $id_or_email, $size, $default, $alt) {

$default = ‘http://yoursite.net/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg’;
return “{$alt}“;
}

add_filter(‘get_avatar’, ‘remove_gravatar’, 1, 5);
`

It worked for me

Skip to toolbar