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
define('WP_POST_REVISIONS', 5);. One missing semicolon takes the site down. Requires server access.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.
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).
-total=5 keeps five. -total=0 disables revisions. -total=-1 restores WordPress's unlimited default.trc_revision_limit option.wp_revisions_to_keep filter returns your stored value. Older revisions prune automatically.| Parameter | Value |
|---|---|
-total(required) | Integer. Positive keeps that many. 0 disables. -1 for unlimited (WP default). |
| Ceiling | Hard cap of 100 — values above are silently clamped down. |
| Storage | WordPress option trc_revision_limit. Applies via the wp_revisions_to_keep filter. |
| Scope | New 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.