Review a week of agent changes and revert the ones you don't want

MaintenanceIntermediate~15 minUpdated

Before you start

Plugin 1.11.2 or newer, with change history left on in Settings (it is on by default). The activity log read needs the manage-options capability, so run this as an administrator, not as a least-privilege agent user. The agent only reads. The reverting is yours, in the Changes tab of the plugin's wp-admin screen, which keeps changes for up to 30 days.

An agent has been working on your site for a week and you want to know what it actually did. Not the call counts, but which posts moved, and which of those edits you would rather not keep.

The activity log can tell you what ran and where. The Changes tab is where you act on it. This puts the two together: the agent reads the log and builds you a short list, and you take the list to the Changes tab and revert what you don’t want.

The prompt
Review the last seven days of agent changes on this site and give me a list I
can check against the Changes tab in wp-admin. Read only.
Read this plugin's activity log newest first, 200 rows a page, and keep paging
until created_at (UTC) is older than seven days ago. The read has no date
filter, so that is the only way to bound it. If it takes more than five pages,
stop and tell me how far back you got. Ask only for rows with status success.
Keep only calls to these tools: update-post, update-page, update-cpt-item,
replace-in-post, replace-block, replace-sitewide, create-draft, create-post,
create-page, create-cpt-item, trash-post, trash-page, delete-block,
add-post-terms, update-term, update-post-meta, delete-post-meta,
update-term-meta, delete-term-meta, set-featured-image, yoast-update-post,
rankmath-update-post, rankmath-update-schema, slim-seo-update-post and
aioseo-update-post. Count everything else on one line and leave it out.
Group what is left by day. For each call give me the time, the tool, the
account it acted as, and the ID in the log's detail note (it says post or
term). For each post ID, read the post once and add its title. Leave term IDs
as they are. Flag any call whose argument names include status, content or slug, and
any call from replace-sitewide.
I know the log holds argument names and IDs, not what was written, so do not
guess at the text. Finish by telling me which rows to look at first in the
Changes tab, and remind me that I do the reverting there.

Why this is safe to run

Both abilities are reads. The activity log read changes nothing in the log, and reading a post to get its title changes nothing on the post. The agent cannot revert anything in this recipe, and that is deliberate: the Revert button sits in wp-admin, behind your own login.

The log withholds the text of every call, so the list tells you what ran and where, not what was written. That is the gap the Changes tab fills. For each change it shows the time, the tool, the item, the field names touched, who made it and whether it can still be reverted, and the Revert button puts the earlier value back. Revert is refused when the item has been edited since or when it would overwrite a newer edit, so a revert cannot silently undo someone’s later work. Reverting is itself recorded in the Activity Log.

Know the edges before you rely on it. The tab covers 25 of this plugin’s tools: edits to posts, pages and custom post types, creates, trashes, block edits, terms, custom fields, featured images and SEO fields. It does not cover permanent deletes, orders, refunds, user accounts, uploads, WooCommerce products, ACF field values, menus, comments, events or tools from other plugins, so those calls will not show up in the tab even when they were in the log. For those, the log is your record and a backup is your way back.

Already connected? Skip the paste. Ask your agent, as an admin, for the “review a week of agent changes” recipe, or just ask what it changed this week, and it builds the same list from your own log.

How it works

  1. Read the activity log, newest first, back across the last seven days.
  2. Keep only the successful calls to the tools the Changes tab records, and set the rest aside.
  3. Look up the title of each post those calls touched, using the post IDs in the log's detail notes.
  4. Hand you a list by day with the tool, the account and the post, flagging calls that passed a status, content or slug argument.
  5. You open the Changes tab, find those rows, check the fields they touched, and click Revert on the ones you don't want.

Questions

Can the agent revert the changes for me?
Not these ones. The agent's own undo tools reach only changes its own connection made in the last 24 hours. Reverting a week of changes, or changes from other connections, is a Revert click in the Changes tab, which only a site owner can use.
What can the agent see about each change?
The activity log gives the tool name, the account, the time, the argument names that were passed and, for most write tools, a short note naming the post or term ID. It never holds the text that was written. The Changes tab adds the field names each change touched, still not their contents.
Why won't the Changes tab revert one of them?
A revert is refused if the item was edited after the change, or if putting the old value back would overwrite a newer edit. A change older than 30 days has expired, and tools outside the 25 the plugin records never appear there at all.
What about a find-and-replace that touched many posts?
Changes from one sitewide find-and-replace are grouped. The Changes tab offers Revert all for the group, which reverts every post in it that is still unchanged since, and tells you how many it could not.