# BuddyPress: Last Active Column on the Users Screen

> Adds a "Last active" column to the WordPress Users screen using BuddyPress's activity tracking, so you can see who is actually using the community.

- Type: PHP
- Runs: Admin only
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: buddypress, users, reporting
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/buddypress-last-active-users-column/

## Code

```php
if ( ! function_exists( 'buddypress' ) ) {
    return;
}

add_filter( 'manage_users_columns', function ( $columns ) {
    $columns['wpide_bp_active'] = 'Last active';

    return $columns;
} );

add_filter( 'manage_users_custom_column', function ( $output, $column, $user_id ) {
    if ( 'wpide_bp_active' !== $column ) {
        return $output;
    }

    $last = bp_get_user_last_activity( $user_id );

    return $last ? esc_html( sprintf( '%s ago', human_time_diff( strtotime( $last . ' UTC' ) ) ) ) : 'Never';
}, 10, 3 );
```

## Notes

Shows "Never" for members who have not been active since BuddyPress was installed.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "BuddyPress: Last Active Column on the Users Screen" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
