EID Special Deals

40%OFF

Simplify Admin

APPLY COUPON & SEE THE PRICE DROP

00

Days

00

Hours

00

Min

00

Sec

Use Code:
EIDGIFT
Claim 40% off

How to Show Last Login Column in WordPress Users List (2026)

Ever opened your WordPress Users screen and wondered, "When did this person last log in?" By default, WordPress doesn't track or display user login timestamps - a frustrating gap when you're managing a multi-author blog, membership site, or client project with several admin accounts.

Knowing when each user last logged in helps you spot inactive accounts, identify potential security issues, and keep your team accountable. In this guide, you'll learn two ways to add a Last Login column to your WordPress Users list: the quick, no-code method using WP Adminify's Productivity tools, and the developer-friendly approach using custom PHP code.

What Is a Last Login Column in WordPress?

A last login column is an additional column added to the Users > All Users screen in the WordPress admin dashboard that displays the exact date and time each user last authenticated. Once enabled, WordPress records a timestamp every time a user logs in, and that timestamp is displayed directly in the users table - right alongside the Username, Email, Role, and Posts columns.

This gives site administrators instant visibility into user activity without needing to install a full-blown activity logging plugin or dig through server access logs. If you want to go beyond login tracking and monitor all user activity in WordPress, there are options for that too - but a last login column is the simplest starting point.

Why Tracking User Last Login Matters

Adding a last login column isn't just a nice-to-have — it solves real operational problems:

Security Monitoring

Stale user accounts are a security liability. If an editor hasn't logged in for six months, their account could be compromised without anyone noticing. By tracking last login timestamps, you can quickly identify dormant accounts and take action - whether that means reaching out to the user, resetting their password, or downgrading their role. Pairing this with two-factor authentication adds another layer of protection for accounts that are still active.

WordPress security best practices recommend regular audits of user accounts. The WordPress Codex on Roles and Capabilities emphasizes the principle of least privilege, and knowing when users last logged in is the first step in enforcing it.

Team Accountability

For agencies managing content teams or multi-author publications, knowing who's actively logging in tells you who's engaged and who might need a nudge. If a contributor was assigned articles but hasn't logged in for weeks, that's a workflow flag you want to catch early.

Membership and Client Sites

On membership sites powered by WooCommerce Memberships, MemberPress, or similar plugins, tracking last login helps you understand engagement. For client sites - especially if you've built a custom client dashboard - it helps justify ongoing maintenance by demonstrating that the admin tools you've set up are actually being used.

Compliance and Audit Trails

Some industries require access logging for compliance (HIPAA, GDPR data access records, SOC 2). While a last login column alone isn't a full audit trail, it provides a quick reference point that complements more detailed solutions like the Activity Logs addon - which records every user action, not just logins.

Method 1: Add Last Login Column Using WP Adminify (No Code)

The fastest way to add a last login column is with WP Adminify, which includes this feature as part of its Custom Admin Columns module - no code, no additional plugins.

Step 1: Install and Activate WP Adminify

If you haven't already installed WP Adminify, head to Plugins > Add New in your WordPress dashboard, search for "WP Adminify," and click Install Now followed by Activate. The plugin is free on WordPress.org with 7,000+ active installations.

Installing WP Adminify plugin in infinityFree WordPress

Step 2: Navigate to Custom Admin Columns

Go to WP Adminify > Settings and click the Productivity tab. Scroll down until you find the Custom Admin Columns section.

Make sure the Custom Admin Columns toggle is set to SHOW (green). This reveals all the available column options.

Step 3: Enable the Last Login Column

Under the Custom Admin Columns options, you'll see several checkboxes:

  • Show Post Thumbnails Column
  • Show Post/Page ID Column
  • Show "Comment ID" Column for Comment
  • Show "Last Login" Column for Users
  • Show "Taxonomy ID" Column
  • Show "URL Path" Column for Post Types
show last login column for wordpress users

Check the box next to Show "Last Login" Column for Users and click Save Settings.

That's it - no page refresh gymnastics, no configuration screens. One checkbox, one save.

Step 4: Verify the Last Login Column

Navigate to Users > All Users in your WordPress dashboard. You'll now see a new Last Login column on the far right of the users table.

The column displays the full date and time in YYYY-MM-DD HH:MM:SS format, so you know exactly when each user last authenticated. The timestamp updates automatically every time a user logs in - no manual action required.

last user login column in user list

Note: The last login timestamp is recorded from the moment the feature is enabled. Users who logged in before you activated this option will show an empty value until their next login.

Bonus: Other Useful Admin Columns

While you're in the Custom Admin Columns settings, consider enabling these other productivity boosters:

  • Post Thumbnails Column - See featured images at a glance in your Posts/Pages list
  • Post/Page ID Column - Instantly grab post IDs without hovering or inspecting elements (handy for shortcodes and custom queries)
  • URL Path Column - View the slug/permalink directly in the post list

These columns are part of WP Adminify's Productivity features, all designed to reduce clicks and speed up your admin workflow. For a deeper look at which columns actually save time, check out our guide on essential admin columns for WordPress. And if you need even more control - like adding ACF fields as admin columns - the Admin Columns Editor addon has you covered.

Method 2: Add Last Login Column Using Custom Code

If you prefer a code-based approach - perhaps you're building a custom theme, want to avoid plugin dependencies, or just enjoy writing PHP - here's how to add a last login column with a few functions in your theme's functions.php file or a custom plugin.

Step 1: Record the Login Timestamp

First, hook into WordPress's wp_login action to save a timestamp as user meta every time someone logs in:

1
2/**
3 * Record user's last login timestamp.
4 *
5 * @param string  $user_login The username.
6 * @param WP_User $user       The WP_User object.
7 */
8function wpat_record_last_login( $user_login, $user ) {
9    update_user_meta( $user->ID, '_last_login', current_time( 'mysql' ) );
10}
11add_action( 'wp_login', 'wpat_record_last_login', 10, 2 );
12

This stores the login time in the _last_login user meta field using WordPress's current_time( 'mysql' ) function, which respects your site's timezone settings configured under Settings > General.

Step 2: Add the Column Header to the Users Table

Next, register a new column in the Users list table:

1
2/**
3 * Add "Last Login" column to the Users list table.
4 *
5 * @param array $columns Existing columns.
6 * @return array Modified columns.
7 */
8function wpat_add_last_login_column( $columns ) {
9    $columns['last_login'] = __( 'Last Login', 'your-textdomain' );
10    return $columns;
11}
12add_filter( 'manage_users_columns', 'wpat_add_last_login_column' );
13

Step 3: Display the Login Timestamp in the Column

Now populate the column with the stored timestamp:

1
2/**
3 * Display the last login timestamp for each user.
4 *
5 * @param string $output      Custom column output.
6 * @param string $column_name Column identifier.
7 * @param int    $user_id     User ID.
8 * @return string Column content.
9 */
10function wpat_show_last_login_column( $output, $column_name, $user_id ) {
11    if ( 'last_login' === $column_name ) {
12        $last_login = get_user_meta( $user_id, '_last_login', true );
13        if ( ! empty( $last_login ) ) {
14            $output = esc_html( $last_login );
15        } else {
16            $output = __( 'Never', 'your-textdomain' );
17        }
18    }
19    return $output;
20}
21add_filter( 'manage_users_custom_column', 'wpat_show_last_login_column', 10, 3 );
22

Step 4: Make the Column Sortable (Optional)

To allow sorting users by their last login date, add this:

1
2/**
3 * Make the Last Login column sortable.
4 *
5 * @param array $columns Sortable columns.
6 * @return array Modified sortable columns.
7 */
8function wpat_last_login_sortable( $columns ) {
9    $columns['last_login'] = 'last_login';
10    return $columns;
11}
12add_filter( 'manage_users_sortable_columns', 'wpat_last_login_sortable' );
13
14/**
15 * Handle the sorting query for last login.
16 *
17 * @param WP_User_Query $query The user query.
18 */
19function wpat_last_login_sort_query( $query ) {
20    if ( 'last_login' === $query->get( 'orderby' ) ) {
21        $query->set( 'meta_key', '_last_login' );
22        $query->set( 'orderby', 'meta_value' );
23    }
24}
25add_action( 'pre_get_users', 'wpat_last_login_sort_query' );
26

Complete Code (All-in-One Snippet)

Here's the full solution you can drop into your functions.php or a custom plugin file:

1
2/**
3 * Add a "Last Login" column to the WordPress Users list.
4 * Records login timestamps and displays them in the admin.
5 */
6
7// Record login timestamp
8function wpat_record_last_login( $user_login, $user ) {
9    update_user_meta( $user->ID, '_last_login', current_time( 'mysql' ) );
10}
11add_action( 'wp_login', 'wpat_record_last_login', 10, 2 );
12
13// Add column header
14function wpat_add_last_login_column( $columns ) {
15    $columns['last_login'] = __( 'Last Login', 'your-textdomain' );
16    return $columns;
17}
18add_filter( 'manage_users_columns', 'wpat_add_last_login_column' );
19
20// Populate column
21function wpat_show_last_login_column( $output, $column_name, $user_id ) {
22    if ( 'last_login' === $column_name ) {
23        $last_login = get_user_meta( $user_id, '_last_login', true );
24        $output     = ! empty( $last_login ) ? esc_html( $last_login ) : __( 'Never', 'your-textdomain' );
25    }
26    return $output;
27}
28add_filter( 'manage_users_custom_column', 'wpat_show_last_login_column', 10, 3 );
29
30// Make column sortable
31function wpat_last_login_sortable( $columns ) {
32    $columns['last_login'] = 'last_login';
33    return $columns;
34}
35add_filter( 'manage_users_sortable_columns', 'wpat_last_login_sortable' );
36
37function wpat_last_login_sort_query( $query ) {
38    if ( 'last_login' === $query->get( 'orderby' ) ) {
39        $query->set( 'meta_key', '_last_login' );
40        $query->set( 'orderby', 'meta_value' );
41    }
42}
43add_action( 'pre_get_users', 'wpat_last_login_sort_query' );
44
Add Last Login Column Using Custom Code

Important considerations with the code approach:

  • Theme updates will erase your code if you add it to a parent theme's functions.php. Use a child theme or a site-specific plugin instead.
  • No UI to toggle it on/off - once the code is active, the column is always visible. With WP Adminify, you can disable it with a single checkbox.
  • No retroactive data - just like the WP Adminify method, timestamps are only recorded from the moment the code is active.

WP Adminify vs Custom Code: Which Should You Choose?

CriteriaWP AdminifyCustom Code
Setup time~30 seconds10-15 minutes
Code requiredNonePHP (functions.php or plugin)
Toggle on/offOne checkboxRemove/comment out code
Sortable columnBuilt-inRequires extra code
Theme update safeYes (plugin-based)No (unless child theme/plugin)
Additional features60+ admin tools includedOnly what you code
Best forSite managers, agencies, non-developersDevelopers who avoid plugins

For most WordPress users, WP Adminify is the practical choice - you get the last login column plus 60+ admin features that replace multiple plugins without writing a single line of code. Developers who want full control or are already running a lean custom setup may prefer the code approach.

Questions for Adding Last Login column

Does the last login column work for all user roles?

Yes. Whether a user is an Administrator, Editor, Author, Subscriber, or any custom role, the last login timestamp is recorded when they authenticate. The column displays data for every user in your WordPress site, regardless of their role.

Will it show login data for users who logged in before I enabled this feature?

No. The last login timestamp is only recorded from the point you enable the feature - either by checking the box in WP Adminify or by adding the custom code. Users who logged in before activation will show an empty value (or "Never" with the code method) until their next login.

Does tracking last login affect site performance?

Not noticeably. Recording a login timestamp writes a single row to the wp_usermeta table - a negligible database operation that happens only during authentication. Displaying the column on the Users screen adds one lightweight query. Even sites with thousands of users won't see a performance impact.

Can I export or sort users by their last login date?

With the custom code method above, you can sort the column directly in the Users table. WP Adminify also supports sortable admin columns. For exporting, you can use plugins like WP All Export to include user meta fields (like _last_login) in CSV exports.

Is WP Adminify free for this feature?

Yes. The Last Login Column feature is available in the free version of WP Adminify on WordPress.org. You don't need the Pro version to use Custom Admin Columns.

Can I customize the date format displayed in the column?

With the custom code approach, you can modify the wpat_show_last_login_column function to format the date using PHP's date() or WordPress's wp_date() function. For example, replace esc_html( $last_login ) with esc_html( wp_date( 'M j, Y g:i A', strtotime( $last_login ) ) ) to display a more readable format like "Apr 11, 2026 3:58 AM."

Conclusion

Adding a last login column to your WordPress Users list is a small change that delivers real value for security monitoring, team management, and site administration.

Here's a quick recap:

  • WP Adminify method: Navigate to WP Adminify > Settings > Productivity > Custom Admin Columns, check "Show Last Login Column for Users," and save. Done in 30 seconds.
  • Custom code method: Add four functions to your functions.php or a custom plugin to record timestamps, register the column, display data, and enable sorting.
  • Both methods only track logins from the moment they're activated - no retroactive data.

If you're already using WP Adminify for dashboard customizationadmin menu editing, or white labeling, the last login column is just one more checkbox in your existing setup. If you're not using it yet, give WP Adminify a try - it's free and takes under a minute to set up.

Get notified about Updates & Offers

Subscribe to get Updates & Offers

You Might Also Like:

Leave a Comment

Your email address will not be published

Coupons