Sign inBlogSupportContact
Tools

Cap how many revisions WordPress stores per post

WordPress saves every single edit forever by default. Set a limit in one command — no wp-config edit, no FTP, no missing semicolon disaster. Capped at 100 so you can't accidentally blow up your database.

2 min read May 2026 limit revisions

WordPress's default is "keep all revisions forever"

Every time you hit Save Draft, Update, or autosave does its thing, WordPress writes a new row to wp_posts. The previous version isn't overwritten — it's kept as a revision. The default is unlimited. A content-heavy blog with twenty posts a month, each edited ten times during drafting, generates 2,400 revision rows per year that no human will ever look at.

What most people do instead

Edit wp-config.php via FTPdefine('WP_POST_REVISIONS', 5);. One missing semicolon takes the site down. Requires server access.
Install a revisions-control pluginAnother plugin page in your menu. Another set of settings. Another thing to update.
Leave it unlimited and hopeRevisions quietly accumulate until backups fail or the database size alert fires.

A better way: store the limit as an option

Run limit revisions -total=5. The command writes your chosen limit to the trc_revision_limit option, which TrueCommander reads via the wp_revisions_to_keep filter on every save. From that moment on, WordPress keeps at most five revisions per post — older ones are pruned automatically as new ones arrive. No FTP, no code file, no deploy.

TrueCommander
Revision limit set
Applied immediately
Limit: 5 per post
Disabled: no
Unlimited: no

Capped at 100 — you can't set a pathological value. Passing -total=9999 silently clamps to 100. The cap exists because someone eventually tries to "keep all revisions but with a number" and WordPress storing 9999 rows per post is how database panics start. Zero disables revisions entirely; minus-one means unlimited (WordPress default).

How it works

The command casts -total to an integer, clamps negative values to -1 (unlimited) and values above 100 to 100, then stores the result in the trc_revision_limit option. WordPress reads the limit via TrueCommander's wp_revisions_to_keep filter during every post save — the limit applies to new revisions created going forward. Existing revision rows are untouched (use clear revisions to flush those).

1
Pick a number-total=5 keeps five. -total=0 disables revisions. -total=-1 restores WordPress's unlimited default.
2
Value clamped and storedNegative becomes -1. Above 100 becomes 100. Stored as the trc_revision_limit option.
3
Applies to every future saveOn each post save, the wp_revisions_to_keep filter returns your stored value. Older revisions prune automatically.
ParameterValue
-total(required)Integer. Positive keeps that many. 0 disables. -1 for unlimited (WP default).
CeilingHard cap of 100 — values above are silently clamped down.
StorageWordPress option trc_revision_limit. Applies via the wp_revisions_to_keep filter.
ScopeNew revisions only. Existing rows untouched — pair with clear revisions for the initial flush.
Can be used in

Real example

You manage a blog with 200 published posts and an editorial team that autosaves aggressively during drafting. A one-year audit shows each post averages 14 revisions — so roughly 2,800 revision rows sitting in wp_posts, less than a percent of which anyone would ever open.

You run limit revisions -total=3. Three revisions is enough to recover from a bad edit yesterday; anything deeper is history nobody wants. Going forward, WordPress trims automatically as new revisions arrive. One command, a one-line option, zero code deploys.

Goes further with TrueCommander

Ready?

Cap revision bloat before it starts.

This is one of 91 commands. All included with every license.

Cookies. The short version.

Essential cookies keep the cart and theme working. Analytics only fire if you say yes. Read our policy.