An activity log you can trust: what to record and for how long
When something goes wrong on a WordPress site, the first question is who changed what. What a useful activity log records, why tamper evidence matters, and how long to keep it.
Sooner or later every site has a morning where something is different. A page vanished, a plugin was switched off, a new administrator appeared that nobody recognises. WordPress itself keeps almost no record of who did what, so without an activity log the investigation starts with guesswork and ends with "it must have been a glitch".
What is worth recording
NIST's guide to computer security log management makes a point that applies to small sites as much as to large organisations: logs are only useful if you decide in advance what to capture and actually look at them. For a WordPress site, that means:
- Sign-ins: successful ones, failed ones, lockouts, and from where.
- People and permissions: new users, deleted users, and above all any change of role to administrator.
- Code: plugins and themes installed, activated, deactivated, updated or deleted, and core updates.
- Settings: changes to site address, permalinks, reading settings and security settings.
- Content: posts and pages published, unpublished, deleted, and who did it.
- Files: changes to core or plugin files outside of an update, which usually means something is wrong.
Each entry needs the same few facts: when, who, from which address, what changed, and ideally the value before and after.
What not to record
More is not better. Logging every page view, every autosave or full request bodies fills the database, slows the dashboard and stores personal data you do not need. The GDPR's storage limitation principle says personal data should be kept no longer than necessary for its purpose. An activity log that records IP addresses is personal data.
Why tamper evidence matters
An attacker who gets administrator access will often try to cover their tracks, and the activity log is the first place they look. Two defences help:
- Make edits detectable. If each log entry includes a cryptographic hash of the entry before it, deleting or changing any entry breaks the chain, and the log can tell you it has been altered. It cannot stop an attacker from deleting everything, but it stops them from quietly rewriting history.
- Send important events elsewhere. An alert by email or to a team chat about a new administrator account is out of the attacker's reach the moment it is sent.
How long to keep it
There is no single right answer. Ninety days covers most "who changed this?" questions. Many organisations keep security-related events for a year, which helps when a compromise is discovered months after it began. Whatever you choose, write it down in your privacy notice and let the log delete older entries automatically.
A habit, not a feature
A log that nobody reads only helps after the damage. A weekly two-minute look at new administrators, failed sign-in spikes and plugin changes catches most problems early. Better still, have the important ones come to you.
In Ironhelm
The activity log records sign-ins, user and role changes, plugin, theme and core updates, settings and content changes: who did what, when and from where. Entries are chained so tampering can be detected, retention is yours to set, and notifications can send the events that matter to email, Slack, Teams or a webhook.
Sources
- NIST, SP 800-92: Guide to Computer Security Log Management
- NIST, SP 800-92 Rev. 1 (draft): Cybersecurity Log Management Planning Guide
- EUR-Lex, GDPR Article 5: Principles relating to processing of personal data
- OWASP, Logging Cheat Sheet
Ironhelm Suite is one WordPress plugin for security, speed, SEO and analytics. See plans or tour the features.