Prune revisions on your heaviest posts

MaintenanceIntermediate~15 min

Before you start

A connected site with content reads and the revision abilities enabled, bound to a user who can edit the posts. Deleting a revision is permanent, so take a database backup before a large run.

A post you have edited fifty times is dragging a long tail of stored revisions behind it. On a handful of heavily worked pages that history adds up in the database, and most of those old snapshots are ones you will never open again. Clearing them out by hand means paging through each post’s history one entry at a time.

This lets the agent find the heaviest posts and propose the trim, while you decide what actually gets removed.

The prompt
I want to trim old revisions on my most-edited posts. Start read only: list
posts and read the revision history on the likely heavy ones, then tell me
which posts have the most stored revisions and how many each is carrying.
Propose a cut for the worst offenders: keep the most recent handful on each
post and list the older revisions you would remove. Wait for me to approve.
Only after I say go, delete just the ones I approved, work in small batches,
and show me each batch before it runs. Deleting a revision is permanent, so do
not touch the live post. When you finish, list what you removed per post and
confirm each published post still reads the same.

Why this is safe to run

Everything up to the delete is reads. Listing posts and reading each one’s revision history writes nothing, so you see how much each post is carrying and exactly which older revisions are on the chopping block before anything is removed.

Deleting a revision is permanent, and this is the one place to be deliberate: revisions have no Trash. The agent works from a list you approve, removes only what you named, and keeps the recent history so a rollback is still there if you want it. It never edits, republishes, or restores the live post, so the published content is untouched throughout. The revision abilities stay off until you enable them, every call is checked against your edit access to the post, and each delete lands in the Activity Log. Take a database backup before a large run.

Already connected? Skip the paste. Ask your agent for the “prune revisions on your heaviest posts” recipe, or just tell it to trim old revisions off your most-edited posts, and it runs the same approve-first flow on your own site.

How it works

  1. List your posts so the agent can find the ones with the most history behind them.
  2. Read the revision list on each candidate and report how many are stored.
  3. Propose which older revisions to remove and keep the recent ones, then wait for your approval.
  4. Delete only the revisions you signed off on, in small batches, showing each batch.
  5. Return the list of what it removed and confirm the live post is unchanged.

Questions

Does this change the published post?
No. Deleting a revision removes an entry from the post's history only. The live post keeps its current content exactly as it stands, and it is never edited, republished, or restored during this.
Can a deleted revision be recovered?
No. Revisions have no Trash, so a delete is permanent. That is why the agent works from a list you approve and removes only older revisions in small batches. Take a database backup before a large run if you want a way back.