How To Activate Imported Buddypress Users

Activating Imported Buddypress users is helpful because if you dont activate the users they don’t appear on searches and on the members directory.

Its pretty straight forward.

1) Use the code snippet (placed in your theme function)
2) Then load your site
3) Then go to the the dashboard -> Tools -> Buddypress -> “repair items”
Caution: Remove the snippet once you are done. It slows down your site otherwise *performed on WP version 4.7.2 & BP version 2.8.1

Heres the snippet:

function daten_add_last_activity() {
    global $wpdb;
    foreach ( $wpdb->get_col( "SELECT ID FROM $wpdb->users" ) as $user_id ) {
        bp_update_user_last_activity( $user_id, bp_core_current_time() );
    }
}
add_action('bp_init', 'daten_add_last_activity' );

Found on BP forum: https://buddypress.org/support/topic/show-profile-of-users-before-they-login-the-first-time/

I’ve tried different methods to get this going.  But this works pretty well.

You can also try using a plugin.  @HNLA on the forums put together this little plugin  https://github.com/hnla/force-show-bp-users But it generates a 500 error for me with 1000+ users