How to track user activity in WordPress
WordPress does not provide a complete, searchable user activity log by default. You can build a limited log with a custom plugin and WordPress hooks, but an audit-log plugin is the practical choice if you need login history, content changes, alerts, reports, or multisite monitoring.
- 01Decide what to record
- 02Check WordPress core limits
- 03Build a custom activity logger
- 04Protect and test the log
- 05Use an audit-log plugin
- 06Review activity regularly
What you need
- Administrator or Super Admin access
- A recent WordPress backup
- A clear list of actions you need to monitor
- An email account for security alerts, if required
Decide what to record
Start with security-relevant events rather than trying to record every page view. Common choices include successful and failed logins, logouts, new users, role changes, profile updates, password changes, post edits, publishing, deletions, plugin changes, theme changes, and important settings updates.
Keep privacy and storage in mind. Activity logs can contain usernames, IP addresses, browser details, and other sensitive information, so restrict access and define how long records should be kept.
Check WordPress core limits
WordPress provides hooks that tell custom code when some actions occur, but it does not give you a complete audit-log screen or a permanent searchable history out of the box. For example, wp_login records successful logins, wp_login_failed records failed attempts, wp_logout records logouts, and profile_update runs after an existing user is updated.
Content changes can be observed with hooks such as save_post, while user creation and option changes need their own handling. A normal WordPress installation will not reconstruct activity that happened before you added logging.
Build a custom activity logger
For a small, controlled site, create a custom plugin or must-use plugin that attaches callbacks to the events you selected. Each callback should record the event name, user ID, timestamp, affected object, and enough context to investigate it later. Store records in a dedicated table or another structure designed for querying rather than writing them into individual user profiles.
Check permissions before recording sensitive data, sanitise values, avoid storing passwords or complete form submissions, and prevent the logger from recording its own database writes. Test login failures, edits, deletions, role changes, and actions performed through the REST API or scheduled tasks.
Protect and test the log
Give log access only to trusted administrators, protect the log from public access, and include the site timezone or use UTC consistently. Add retention and deletion rules so the database does not grow without limit. Back up the log if it is needed for incident investigation, but keep those backups protected as well.
The common Friday failure is discovering that the logger only covered post edits and successful logins, while the important event was a failed login, a role change, a plugin update, or an action taken by a scheduled process. Test the exact events you care about before relying on the records.
Use an audit-log plugin
For most sites, the fast way is to install WP Activity Log, activate it, and review its event and retention settings. It provides searchable audit logs for user actions, login attempts, profile and content changes, with alerts and scheduled reports for ongoing monitoring.
On multisite, install and activate it at network level so activity across the network can be monitored centrally. Limit who can view or manage the log, then create alerts for events such as administrator logins, role changes, new users, plugin changes, and content published by sensitive roles.
Review activity regularly
Use the log as part of a routine security check rather than waiting for an incident. Filter by user, role, event type, object, IP address, or date range, and investigate unfamiliar administrator activity, repeated failed logins, unexpected settings changes, and edits made outside normal working hours.
Generate a report for your chosen review period and confirm that alerts are delivered. A log that nobody reviews, or an alert mailbox that is not monitored, will not help when something goes wrong.
Let WP Activity Log do it
Searchable audit logs, alerts, and scheduled reports for monitoring changes across WordPress sites and multisite networks.
Tools that do this job
All of these solve the task above. They are listed as we have covered them.
Searchable audit logs, alerts, and scheduled reports for monitoring changes across WordPress sites and multisite networks.
Maps visitor paths, form interactions, funnels, and drop-off points for conversion-focused behavior analysis.
Questions
- Does WordPress track user activity by itself?
- No. WordPress exposes hooks for events such as successful logins, failed logins, logouts, profile updates, and post saves, but it does not provide a complete searchable audit history by default. You need custom code to collect selected events, or an activity-log plugin to record and display them consistently.
- Can I track failed WordPress login attempts?
- Yes. Custom code can listen for the <code>wp_login_failed</code> action and record the submitted username or email address, error details, time, and request context. Be careful with IP addresses and retention, and do not store passwords. A security-focused activity-log plugin can collect failed attempts without you having to maintain this code.
- Can I track what a specific WordPress user changed?
- Yes, if the relevant event is being logged. Filter the activity log by username or user ID, then review changes such as logins, profile edits, role changes, post updates, deletions, and settings changes. Core hooks do not cover every action performed by plugins, so custom code may miss important events unless it supports those plugins too.
- Will a new activity log show what happened before installation?
- No. An activity logger normally records events from the point at which it is active. It cannot recreate earlier edits, logins, or deletions unless another system already recorded them. Take a backup before changing the logging setup, and keep the logger active so there are no gaps in the audit trail.
- Is custom code enough for a WordPress activity log?
- Custom code is fine when you need to record a small number of known events on one site and can maintain it safely. It becomes unsuitable when you need searchable history, plugin-specific events, alerts, reports, retention controls, or multisite coverage. In those cases, an audit-log plugin is usually faster and less error-prone.