An audit log is the only part of your site whose entire value is realised in the future, under stress, by someone trying to answer a specific question quickly. That is a demanding design brief, and it is worth being deliberate about.
What actually needs recording
The useful test is not “is this event interesting?” It is: would I need this to answer a question I could plausibly be asked? That narrows things considerably.
Authentication. Every sign-in, successful or not. Failures should record the username that was attempted — a run of failures against admin is noise, the same run against a real editor’s username is an attack with a target. Blocked attempts matter separately from failed ones: a failure means wrong credentials, a block means your controls did their job.
Authorisation changes. Role changes are the highest-value entries in the entire log, because privilege escalation is what an attacker actually wants. Who was promoted, by whom, when.
Account lifecycle. Registrations, deletions, disables, password changes and resets, email changes. An email change immediately followed by a password reset is account takeover in two events, and neither is alarming alone.
Application passwords. Creation and deletion. These are long-lived credentials that bypass the login form entirely, and they are the single most commonly forgotten access path on a WordPress site.
Site-level change. Plugin activations, theme switches, core updates. Not user activity as such, but the answer to “what changed just before this broke?” is nearly always here.
Content. Published, updated, trashed, deleted. Useful, and also the highest-volume category by a wide margin — which is the next problem.

Volume is the real enemy
On a busy site, content edits will outnumber security events by two or three orders of magnitude. A log that treats “post updated” and “administrator role granted” as equally prominent is not a security tool. It is a firehose with a search box.
The fix is severity, assigned at write time rather than inferred later. A failed login is informational; a blocked login against a disabled account is a warning; a role change is a warning; a bulk deletion is critical. Once severity exists, the default view can show what matters and the detail stays available underneath.
Filtering matters as much as recording. Event type, user, the actor who performed it, IP, severity, date range. Note that user and actor are different fields and both are needed: “what happened to this account” and “what did this person do” are different questions, and during an incident you will ask both.
Where it is stored is not a detail
Some plugins store activity in wp_options, or as a custom post type. Both are mistakes, for different reasons.
wp_options is the wrong shape and carries an autoload risk that can put your entire log into memory on every request. A custom post type drags the whole post/meta machinery into what should be an append-only write, and querying it means joining against wp_postmeta — which is exactly the query pattern that makes large WordPress sites slow.
An audit log is append-heavy, read-rarely, and queried on a handful of predictable columns. That is a table with indexes on those columns. Anything else is going to make you choose between keeping history and keeping the site fast.
The flood problem
Here is a failure mode that is easy to miss until it happens.
A brute-force attempt generates thousands of failed logins in minutes. Each one is a row. If your retention policy is time-based, that is fine. If it is size-based, or if the table simply grows until something falls over, the attack has just pushed your genuinely interesting history out of the log.
An attacker does not need to edit your log to destroy its value. They only need to fill it. Repeated identical failures should be aggregated rather than written one row per attempt — you lose nothing analytically, since a thousand identical failures tell you exactly what ten do, and the log survives.
Retention, and the tension nobody names
Long retention helps investigations. Short retention respects the people in your log. These pull in opposite directions and no default resolves it for you.
The practical answer is to pick a period you could defend to two different audiences: long enough that you could investigate an incident discovered late, short enough that you are not hoarding behavioural data about your contributors indefinitely. For most sites that is somewhere between 90 days and a year. “Forever” should be a deliberate compliance decision, not a default.
IP anonymisation is the other half. Zeroing the last octet before storage keeps addresses useful for spotting patterns while stopping the log being a precise location history. Note that this has to happen at write time — anonymising on display leaves the real data in the database, which is not anonymisation at all.

Tamper evidence, and what it honestly buys you
An audit log that can be edited without trace is evidence of nothing. If the first thing a competent intruder does is delete the rows describing their arrival, the log confirms only that nothing suspicious was left behind.
The standard answer is hash chaining. Each entry includes a hash computed over its own contents plus the hash of the entry before it. Change any historical row and its hash no longer matches what the next row recorded, and every subsequent link breaks. Deleting a row leaves the same gap.
This is genuinely useful, and it is also routinely oversold. Be precise about the guarantee.
What it detects: tampering at the database level. An edited SQL dump. A rogue database user. SQL injection that reaches the log table. Someone with phpMyAdmin and a motive. These are realistic threats and chaining catches all of them.
What it does not detect: an attacker who has fully compromised the server. If they can run your PHP, they can read the same key and recompute the chain from the point they edited onward. The result is internally consistent and verifies clean.
That is not a flaw in the implementation. It is a limit of any scheme where the thing being protected and the means of protecting it live on the same machine. The only real answer is shipping entries off the box as they are written, which is a different feature with different operational costs.
Any vendor claiming their on-server log is tamper-proof is either being loose with language or has not thought it through. Tamper-evident, against a bounded threat model, is the accurate claim — and still worth having.
The detail that catches implementations out
Once you chain entries, your own retention policy becomes a problem. Purging entries older than 90 days deletes rows. Deleted rows break the chain. Your log now reports tampering every time it does exactly what you configured it to do.
So legitimate deletion has to record itself — the purge writes its own entry describing what it removed, and verification treats that as an accounted-for gap rather than interference. Without it you get alert fatigue on a signal that is supposed to be rare, and a rare signal you have learned to ignore is worse than no signal.
Questions worth asking
Whatever you use, these are answerable in a few minutes and tell you most of what you need:
- Does it record failed logins with the attempted username, or just a count?
- Are role changes recorded, and is the actor recorded separately from the subject?
- Does it log application password creation?
- Where does the data live — its own table, or
wp_options? - Can a burst of failed logins flush your real history out?
- Can you export it, and would that export mean anything to an auditor?
- If tamper-evidence is claimed, against what threat — and does the vendor say so plainly?
How ITX UserOps handles it
Separate login and activity logs, in their own indexed tables. Severity assigned at write time; filtering on event, user, actor, IP, severity and date; full-text search and CSV export. Retention from 30 days to indefinite with a daily purge, and IP anonymisation applied before storage rather than on display. Repeated failures are aggregated so a brute-force attempt cannot flush your history.
Entries are hash-chained, with the limits described above stated plainly in the documentation rather than buried — it detects database-level tampering, not a full server compromise. Retention purges record themselves, so routine deletion is never mistaken for interference.
Free and GPL, with no external requests: nothing about your site or your users is sent anywhere. The source is on GitHub.
