You can use wp-cli-buddypress to delete the activities from the command line: https://github.com/buddypress/wp-cli-buddypress
Not what you are serching for but plugin BuddyPress bulk delete can delete all activity.
Thank you. I feel the plugin will be less confusing for me
That plugin was bad advice. It deleted thousands of profiles.
actually it made them unsearchable so I’m not sure what the issue is
@mbfit If by “unsearchable” you mean that they don’t show up in the directory anymore, then the problem is probably that the plugin deleted the ‘last_activity’ activity items for each user. As such, BP doesn’t show them as active users.
If you retained a backup before you ran the delete process, then you should restore the last_activity items from it. If not, you can run a script that will set last_activity for all users that don’t have it set – though note carefully that it won’t really be *accurate*.
function bbg_set_last_activity() {
global $wpdb;
$user_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->users}" );
foreach ( $user_ids as $user_id ) {
if ( bp_get_user_last_activity( $user_id ) ) {
continue;
}
bp_update_user_last_activity( $user_id );
}
}
As to your original question, there is no single UI or command you can run to delete activity items based on date. wp-cli-buddypress would be part of a good solution, but it would take additional scripting to delete based on date range. If you have some familiarity with bash scripting or PHP scripting, I will point you in the right direction, but I don’t want to just give you stuff to copy and paste, because deleting stuff is dangerous đ
@mbfit If by âunsearchableâ you mean that they donât show up in the directory anymore, then the problem is probably that the plugin deleted the âlast_activityâ activity items for each user. As such, BP doesnât show them as active users.
Yes you nailed it.
Tech support copied the file members-loop.php from the main theme to the child theme, so it looks like this childtheme/buddypress/members/members-loop.php
and code:
<?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ) . ‘&per_page=’.sq_option( ‘buddypress_perpage’ ) ) ) : ?>
to:
<?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ) . ‘&type=alphabetical’ . ‘&per_page=’.sq_option( ‘buddypress_perpage’ ) ) ) : ?>
In case anyone else every happens to run into this..!
Yes, the alphabetical
sort doesn’t require last_activity, which is why it probably caused it to work. In any case, I’m glad you’ve got it sorted out!