You can place this in your theme/functions.php or in bp-custom.php.
It will stop recording entries for 3 types after you include the function.
You can add other types
as desired to the $exclude
array.
function steve_dont_save_activity( $activity_object ) {
$exclude = array( 'new_avatar', 'updated_profile', 'friendship_created' );
if( in_array( $activity_object->type, $exclude ) )
$activity_object->type = false;
}
add_action('bp_activity_before_save', 'steve_dont_save_activity', 1, 1 );
To delete existing entries, use the interface here
[yoursite]/wp-admin/admin.php?page=bp-activity
THanks for the response. I am getting an error when adding this, any thoughts?
function steve_dont_save_activity( $activity_object ) { $exclude = array( ‘new_avatar’, ‘updated_profile’, ‘friendship_created’ ); if( in_array( $activity_object->type, $exclude ) ) $activity_object->type = false; } add_action(‘bp_activity_before_save’, ‘steve_dont_save_activity’, 1, 1 );
Warning: Cannot modify header information – headers already sent by (output started at /home2/sparker/public_html/jungportal.com/wp-content/plugins/bp-custom.php:13) in /home2/sparker/public_html/jungportal.com/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 62
Wait. I think I got it to work. I originally put it in the bp-custom file but then switched it to my child theme function file. I think it is working. I will let you know.
Thanks.
The function should be in one file only. And you are using a cache. Clear it !
i need to remove (are now friend, became a registered member, change profile or cover photo) in all activity pages, any help please?
@shwikiart
Try this: https://codex.buddypress.org/developer/loops-reference/the-activity-stream-loop/#filtering-examples
Copy the activity-loop.php file into your child theme and then update line 18 with the settings that suit you using the guide in the link to help.