WordPress Activity Logs That Survive a Hack: What to Record, Plugin Options Compared, Off-Site Log Copies and Alerts Worth Turning On

By Information Security Asia · Updated November 30, 2026 · 7 min read

WordPress Activity Logs That Survive a Hack: What to Record, Plugin Options Compared, Off-Site Log Copies and Alerts Worth Turning On

Short answer: To set up WordPress activity logs, install a reputable logging plugin such as WP Activity Log, Simple History or Stream, and make sure it records logins and failed logins, user creation and role changes, plugin and theme installs, updates and file edits, settings changes, and content changes. Then fix the weakness most setups have: logs stored in the WordPress database can be deleted by any attacker who gains administrator access. Send copies off the server, through a plugin feature that supports external logging, email or chat alerts, or your server’s own logs. Turn on alerts for new administrators and plugin installs, set a retention period that balances investigation needs with privacy, and combine activity logs with server access logs and file change monitoring.

Why activity logs matter after a compromise

When a WordPress site is hacked, the first questions are always the same: how did they get in, when, and what did they change? Without logs, cleanup becomes guesswork, and you may miss a backdoor administrator account or a malicious plugin the attacker installed. With good logs, you can see that a new admin user appeared at 02:14, that a plugin called something innocuous was installed a minute later, and that the attacker logged in from an IP address you can then block and search for in server logs.

WordPress Activity Logs That Survive a Hack: What to Record, Plugin Options Compared, Off-Site Log Copies and Alerts Worth Turning On

Activity logs also catch problems that aren’t attacks: a staff member changing a setting that breaks checkout, a plugin update that coincides with an error, or an editor publishing something they shouldn’t.

What to record

Event Why it matters Alert?
Successful and failed logins, with IP and user Spots stolen credentials and brute force Alert on admin login from new location if supported
New user created, role changed to administrator The most common persistence trick Yes, always
Plugin or theme installed, activated, deleted or updated Attackers install malicious plugins Yes for installs
File edits through the theme or plugin editor Direct code injection Yes
Core settings changed (site URL, admin email, user registration, default role) Hijacking and spam registrations Yes for key settings
Posts and pages published, edited or deleted Content tampering, SEO spam Optional
WooCommerce settings and payment changes Fraud and skimming Yes on stores
Password resets and email changes for users Account takeover Yes for administrators

The OWASP Logging Cheat Sheet recommends recording authentication successes and failures, authorization failures, and changes to privileges and configuration, along with who, when, where and what for each event. That maps neatly to the table above.

Plugin options

WP Activity Log

WP Activity Log, by Melapress, is one of the most comprehensive logging plugins. The free version records a wide range of events across users, content, plugins, themes, settings and WooCommerce. Premium editions add features such as email and SMS notifications, reports, user session management and the ability to send logs to external databases or third-party log services. It suits sites where detailed audit trails matter, such as stores and membership sites.

Simple History

Simple History focuses on a clean, readable feed of what happened on the site: logins, content changes, plugin updates, user changes and more. It’s lightweight and easy for non-technical site owners to read in the dashboard. It has add-ons for extra features. It’s a good choice for small business and personal sites that want visibility without complexity.

Stream

Stream records user and system activity with filtering and reporting, and has long been used on agency-managed sites. Check its current maintenance status and compatibility with your WordPress version before choosing it, as with any plugin.

Whichever you choose, check how recently it was updated, how many active installs it has, and whether it’s compatible with your caching and security plugins. Avoid running two logging plugins at once; they duplicate work and bloat the database.

The big weakness: logs on the same server

Most logging plugins store events in custom tables in the WordPress database. That’s convenient, but it means an attacker who gains administrator access, or database access through a vulnerability, can delete or edit the logs. Logs that the attacker can erase are least reliable exactly when you need them most.

Ways to keep a copy the attacker can’t reach:

WordPress Activity Logs That Survive a Hack: What to Record, Plugin Options Compared, Off-Site Log Copies and Alerts Worth Turning On
  • External log storage through a plugin’s integration with a log service, a separate database or syslog, where supported.
  • Real-time notifications for critical events by email or to a team chat. Once sent, the notification sits outside the site even if the log is wiped.
  • Server logs: web server access logs and PHP error logs are written by the server, not WordPress, and record requests to wp-login.php, plugin uploads and admin actions by IP and time.
  • Host-level backups that include the log tables, giving you historical snapshots.

Use server logs alongside the plugin

Activity logs show what happened inside WordPress; server logs show the HTTP requests that caused it. During an investigation you’ll want both. Make sure access logs are enabled and kept for a reasonable period, and know where they are; on cPanel and aaPanel they’re in the panel’s log section. These commands help when you need to trace an event:

# Requests to the login page by IP, most frequent first
grep "wp-login.php" access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head

# Admin-side POST requests around a specific time
grep "03/Dec/2026:02:1" access.log | grep "POST /wp-admin"

WordPress can also write PHP errors to a log file. Setting WP_DEBUG_LOG to a path outside the web root keeps the file from being downloaded by visitors:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', '/home/example/logs/wp-debug.log' );

Turn debug logging off on production when you’re not investigating, because it can grow large.

Alerts worth turning on

Alerts turn logs from something you read after the damage into an early warning. Keep them few enough that you don’t ignore them:

  1. A new user is created with the administrator role, or an existing user is promoted.
  2. A plugin or theme is installed or uploaded.
  3. A file is edited through the built-in editor (better still, disable the editor with DISALLOW_FILE_EDIT).
  4. The site URL, admin email or user registration settings change.
  5. An administrator logs in from a new country, if your plugin supports it.

Retention and privacy

Logs contain personal data: usernames, IP addresses and actions. Keep them long enough to investigate incidents that are discovered late (many compromises are found weeks after they start), but not indefinitely. Many site owners choose a few months for detailed logs. Mention logging in your privacy policy, limit who can view logs to administrators, and make sure your retention matches any legal obligations where you operate.

Complete the picture

Activity logs don’t see changes made directly to files over FTP, SSH or a compromised hosting panel. Pair them with file change monitoring; our guide to WordPress file change monitoring covers checksums and alerts. If you suspect a compromise, our guide to scanning WordPress for malware over SSH helps you look for what the logs point to, and the WordPress security checklist puts logging in context with other priorities.

A 20-minute setup plan

  1. Install one logging plugin and confirm it records logins, user changes and plugin installs.
  2. Set up email or chat alerts for new administrators and plugin installs.
  3. Set a retention period and limit log access to administrators.
  4. Confirm server access logs are enabled and note where they’re stored.
  5. Disable the built-in file editor in wp-config.php.
  6. Test: create a dummy user, install and delete a harmless plugin, and confirm both the log entry and the alert appear.

Frequently asked questions

Do activity log plugins slow down WordPress?

Reputable plugins have a small impact on typical sites. Very busy sites should set sensible retention so log tables don’t grow without limit, or send logs to external storage.

Can an attacker delete WordPress activity logs?

Yes, if they gain administrator or database access and logs are stored only in the WordPress database. That’s why off-site copies and real-time alerts matter.

Are server access logs enough on their own?

They show requests but not what changed inside WordPress, such as which user was promoted. Use both for a complete picture.

How long should I keep WordPress logs?

Long enough to investigate incidents discovered late, often a few months, balanced against privacy obligations. Keep critical alerts and incident-related logs longer if you’re investigating.

Sources

Keep reading