WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to update all users status to recent so they appear on the members list. I am using buddypress.

If you need anything else, just ask.

share|improve this question

closed as off-topic by toscho Aug 2 '14 at 20:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

..are you there? – Androliyah Feb 24 '13 at 1:55

BP uses a meta value called 'last_active' to determine who should be shown in the Members directory. You can write a loop that will set this value for each member. I should note, though, that manually setting this 'last_active' value can lead to misleading results, since the string 'active x minutes ago' appears throughout BuddyPress, and in this case will have been forged.

Anyway, something like this:

global $wpdb;
foreach ( $wpdb->get_col( "SELECT ID FROM $wpdb->users" ) as $user_id ) {
    bp_update_user_meta( $user_id, 'last_activity', bp_core_current_time() );

You may want to insert some logic for excluding spammed/deleted members, but how that's done depends on whether you're running multisite.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.