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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s