Last Login Column
Track when each user last logged into your WordPress site. A “Last Login” column appears in the Users list, showing relative timestamps like “2 hours ago” or “3 days ago” — perfect for identifying inactive accounts and monitoring user activity.
Use Cases
- Identify inactive user accounts that may need cleanup
- Monitor team member activity and engagement
- Spot unusual login patterns that might indicate security issues
- Track when clients last accessed their dashboard
How It Works
- Enable the module in Switchboard
- A “Last Login” column appears in Users → All Users
- Each user’s login time is recorded when they log in
- The column displays relative time (“5 days ago”)
- Click the column header to sort by login date
Where to Find It
Location: Go to Users → All Users to see the “Last Login” column in the user list table.
What You’ll See
| User | Last Login |
|---|---|
| admin | 2 hours ago |
| editor_jane | 3 days ago |
| author_bob | 2 weeks ago |
| subscriber_new | Never |
Column Values
| Display | Meaning |
|---|---|
| X minutes ago | Logged in within the last hour |
| X hours ago | Logged in today |
| X days ago | Logged in within the last month |
| X weeks ago | Logged in within the last few months |
| X months ago | Logged in longer ago |
| Never | User has never logged in (or logged in before module was enabled) |
Sorting by Last Login
Click the “Last Login” column header to sort:
- Ascending: Oldest logins first (find inactive users)
- Descending: Most recent logins first (see active users)
This makes it easy to find accounts that haven’t been used in a long time.
Practical Applications
Finding Inactive Accounts
- Go to Users → All Users
- Click “Last Login” to sort ascending
- Users who haven’t logged in recently appear at the top
- Review and potentially remove stale accounts
Security Monitoring
Look for:
- Unexpected logins at odd hours
- Users showing activity when they should be inactive
- Admin accounts with recent activity when no changes were made
Client Activity Tracking
For agency sites:
- See when clients last accessed their dashboard
- Follow up with clients who haven’t logged in recently
- Verify clients are reviewing content after notifications
Data Storage
Login timestamps are stored as user meta:
- Meta key:
last_login - Format: MySQL datetime (YYYY-MM-DD HH:MM:SS)
- Timezone: WordPress timezone setting
No Configuration Needed
This module has no settings. Enable it and:
- The column appears automatically
- Future logins are tracked
- Existing users show “Never” until they log in
Limitations
Pre-Existing Logins
Users who logged in before enabling this module will show “Never” until they log in again. The module only tracks logins that occur after activation.
Login Method
The module tracks standard WordPress logins. Some SSO (Single Sign-On) or social login plugins may not trigger the tracking hook.
FAQ
Why does a user show ‘Never’ when I know they’ve logged in?
The module only tracks logins after it was enabled. Users who logged in before you activated the module will show “Never” until their next login.Does this track logins via third-party plugins?
Most login plugins that use WordPress’s standardwp_login hook will be tracked. Some SSO or social login systems may bypass this hook.Can I export the last login data?
The data is stored as user meta. You can export it using the User Exporter module or access it programmatically withget_user_meta($user_id, 'last_login', true).Is the exact login time stored or just the relative time?
The exact datetime is stored. The relative display (“3 days ago”) is calculated dynamically for easy reading.Does this affect site performance?
No, the login timestamp is only recorded during login (one database write) and displayed when viewing the Users list. There’s no ongoing performance impact.Combine this with regular security reviews. If you see admin-level accounts that haven’t logged in for months, consider whether they still need access.
This module tracks logins, not activity. A user might be logged in and active for hours, but only the initial login timestamp is recorded.
Get access to all 147 modules with a single license