Who Changed It/Evidence

A WordPress audit log that shows when it has been edited.

The first thing a careful intruder does is delete the rows that describe them. In an ordinary activity log that leaves no mark. Here every record is chained to the one before it with HMAC-SHA256, so a missing or altered row is reported, and an export can be checked years later without WordPress.

Why an ordinary activity log is weak evidence

A WordPress activity log is a database table. Anyone who can write to that table, whether through a compromised administrator account, a SQL injection in another plugin, or a hosting control panel, can remove a row. The table that remains looks complete. When the log is later shown to a client, an insurer or a court, the fair question is "how do you know nothing was removed?", and for most logs there is no answer.

Tamper-evident, not tamper-proof

No software running on a server can stop someone with full control of that server from changing data on it. Products that claim an "immutable" or "tamper-proof" log inside WordPress are describing something that cannot exist there. What can exist is a log where tampering leaves a mark that cannot be covered up without a secret the attacker does not have. That property is called tamper evidence, and it is the claim made here.

How the chain works

Every record stores three hashes:

Change a field and its payload hash no longer matches. Delete a row and the next one points at a hash that is gone. Insert a row and the positions stop lining up. The verifier walks the chain and says which of those happened and where:

3 record(s) removed without an authorized retention or
redaction entry (positions 412-414).

The stored fields no longer match the hash recorded when
this event was written.

Verification status is shown on the log screen and the settings page, and it is included in every digest email.

Put the key in wp-config.php

The chain is exactly as strong as the secrecy of its key. By default the key is generated on first use and stored in the database, which defeats casual edits and accidents. It does not defeat an attacker who can read the database, because they can read the key and recompute a consistent chain.

Moving the key out of the database closes that route:

// wp-config.php
define( 'WHOCHITA_CHAIN_KEY', 'a long random string, unique to this site' );

With the constant defined, database-only access is no longer enough to forge the chain. Three practical points:

Authorised gaps: deleting without breaking the chain

Rows do need to be removed sometimes. Retention pruning runs daily, an administrator may purge the log, and a GDPR erasure changes what a row shows. If each of those broke the chain, every site would be permanently "tampered with" and the warning would mean nothing.

So a legitimate removal records a gap: the positions removed, how many records, the hash of the last one, and the reason. The surviving records still link across it and the chain verifies. A purge is also logged as its own event, classified dangerous, and cannot be muted. Redaction for an erasure request replaces the personal fields while the original payload hash stays, so the chain holds there too.

Anything that removes rows without recording a gap is what gets flagged: a hand-written DELETE, a row edited in phpMyAdmin, a partial database restore.

Signed exports that verify offline

Evidence usually has to leave the site. Each CSV or JSON export carries a manifest, and the manifest is covered by an HMAC-SHA256 signature. It states:

The manifest also contains the algorithm, in words, so the file explains how to check itself. Verification needs the file and the key and nothing else: no WordPress, no plugin, no connection to the site. The five steps are in integrity and evidence.

What a verified chain proves, and what it does not

It proves the records are internally consistent and that nothing was removed or altered without leaving a mark, by anyone who did not hold the key. That is a strong statement about the log.

It is not a statement about the world. The chain cannot show that an event was recorded correctly in the first place. It cannot see what never passed through WordPress: a file changed over SFTP, a row changed directly in the database. An attacker with full control can switch the plugin off, though the gap in an otherwise regular digest is then its own signal. And whoever holds the key can, in principle, rebuild a chain. If the log may one day be used against the party that holds the key, send signed exports to the other side on a schedule, so that a copy exists outside your control.

It does not replace backups or off-site log shipping either. For files on disk, pair it with integrity checks or a scanner such as WPSniffer.

Common questions

Can a WordPress audit log be made tamper-proof?
Not truly. Anyone with full control of the server can change data stored on it. What is achievable is tamper evidence: each record is cryptographically chained to the one before, so removing or editing a row leaves a mark that cannot be hidden without a secret key.
What happens if someone deletes rows from the log table directly?
The next verification reports it. Each record points at the hash of the one before, so a missing row breaks the link and the plugin states how many records were removed and at which positions. Only removals made through retention, purge or erasure record an authorised gap and verify cleanly.
Where should the chain key be stored?
In wp-config.php, as the WHOCHITA_CHAIN_KEY constant, set before you collect records that matter. By default the key is kept in the database, which stops casual edits but not an attacker who can read the database. Use a unique key for every site and back it up with your other secrets.
Can an exported log be verified without access to the site?
Yes. Every export carries a signed manifest and each record's chain hashes. Anyone with the file and the site's chain key can recompute the record digest and the signature with standard SHA-256 and HMAC tools. The method is written inside the manifest itself.
Does GDPR erasure or retention pruning break the hash chain?
No. Pruning records the removed span as an authorised gap, and erasure redacts the personal fields while keeping the hash that sealed the row. Both verify. Deletions made any other way are reported as tampering.