Revisions Control
On this page
Control how many post revisions WordPress keeps per post, with automatic cleanup on save and bulk cleanup tools. Set any limit from 0 to 100, trim excess revisions, or remove all revisions with one click.
Use Cases
- Limit revisions to 5 per post on content-heavy sites to prevent database bloat
- Speed up database backups by reducing the wp_posts table size
- Clean up years of accumulated revisions on an existing site
- Cap revisions on WooCommerce sites where product descriptions change frequently
- Enforce company policies requiring a specific revision count for audit compliance
How It Works
- Set your desired maximum revision count (0-100)
- Save the setting
- Automatic enforcement: Whenever any post is saved, excess revisions are automatically deleted
- Bulk cleanup: Use “Trim Now” to apply the limit to all existing posts immediately
- Nuclear option: Use “Delete All” to remove every revision in your database
Setting 0 disables revisions entirely. Any positive number caps revisions at that amount.
Settings
| Setting | Type | Range | Default | Description |
|---|---|---|---|---|
| Maximum Revisions Per Post | Number Input | 0-100 | 5 | Exact number of revisions to keep per post |
Where to Find It
Location: Switchboard → Optimization → Revisions Control
The settings panel shows:
- Your current total revision count
- How many posts exceed your limit
- How many excess revisions can be removed
Cleanup Options
The settings panel provides two cleanup buttons:
Trim Now (Keep N per post)
This button appears when your limit is set above 0. It:
- Scans all posts with revisions
- Keeps only the most recent revisions up to your limit
- Deletes older revisions beyond the limit
- Reports how many posts were trimmed and revisions deleted
Example: If your limit is 5 and a post has 12 revisions, “Trim Now” keeps the 5 most recent and deletes the 7 oldest.
The “Trim Now” button is disabled when all posts are already within your limit. The panel shows “All posts are within the limit.” in this case.
Delete All Revisions
This removes every single revision from your database, regardless of your limit setting.
This is a destructive action. All revision history for all posts will be permanently deleted. You cannot undo this. Consider taking a database backup first.
Automatic Enforcement
The module automatically enforces your revision limit whenever any post is saved. You don’t need to manually clean up — excess revisions are deleted on every save.
This means:
- New posts never exceed your limit
- Existing posts are trimmed when next edited
- No need to run cleanup regularly
If you want to clean up all existing posts at once (without editing each one), use the “Trim Now” button.
Verification
To confirm the module is working:
- Set your desired revision limit (e.g., 5)
- Edit any post and make several changes, saving between each edit
- Open the “Revisions” panel in the post editor sidebar
- You should see at most the number of revisions you configured
- Excess revisions are automatically deleted on each save
Quick test: If you set the limit to 0, the Revisions panel should be empty after editing and saving a post.
Trim test: Click “Trim Now” and check the confirmation message showing how many posts were trimmed and revisions deleted.
Choosing Your Revision Number
Conservative (More History)
- 15-25 revisions: For sites that need substantial edit history
- Good for: Legal, healthcare, financial sites with compliance requirements
Balanced (Recommended)
- 5-10 revisions: Enough to recover from mistakes, won’t bloat database
- Good for: Most business sites, blogs, portfolios
Aggressive (Minimal Storage)
- 1-3 revisions: Bare minimum for quick recovery
- Good for: High-volume news sites, e-commerce with frequent updates
Disabled
- 0 revisions: No revision storage at all
- Good for: Sites with external version control, temporary content sites
FAQ
What’s the difference between ‘Trim Now’ and ‘Delete All’?
Trim Now keeps your most recent revisions (up to your limit) and deletes only the excess. If your limit is 5, each post keeps its 5 newest revisions.
Delete All removes every revision from every post, leaving no revision history at all.
Why would I need more than 10 revisions?
Some organizations have compliance requirements for content history. Legal documents, financial content, or regulated industries may need to show an audit trail of changes over time. 15-30 revisions provides a reasonable history window.Can I set more than 100 revisions?
The module caps at 100 for practical reasons. If you genuinely need unlimited revisions, don’t enable this module—WordPress defaults to unlimited. Or, set it viawp-config.php for values over 100.Do I need to run cleanup manually?
No. Once you set a limit, excess revisions are automatically deleted whenever a post is saved. The “Trim Now” button is only needed if you want to immediately apply the limit to all existing posts without editing them one by one.Does setting 0 completely stop revision creation?
Yes. With the limit set to 0, WordPress won’t create any revisions when you save posts. The revision metabox in the editor will be empty.I set a limit but it’s not working. Why?
Check ifWP_POST_REVISIONS is defined in your wp-config.php. If it’s defined there, it takes precedence over plugin settings. Remove or comment out that line to let the module control revisions.Can I recover revisions after cleaning them up?
No. Once revisions are deleted, they’re gone permanently. Always back up your database before using the cleanup tools if you think you might need the revision history later.Not sure what number to pick? Start with 5. It’s enough history for content recovery without significant database impact. Adjust up or down based on your actual needs.
Technical Details
This module works by defining the WP_POST_REVISIONS constant during WordPress initialization:
// What the module does internally
if (!defined('WP_POST_REVISIONS')) {
define('WP_POST_REVISIONS', $your_setting);
}Additionally, it hooks into post_updated to automatically trim excess revisions after each save.
If the constant is already defined (in wp-config.php or by another plugin), this module won’t override it.
Database Impact
Here’s a real-world example of how revisions affect database size:
| Revisions per Post | 100 Posts | 500 Posts | 1,000 Posts |
|---|---|---|---|
| 5 | 500 rows | 2,500 rows | 5,000 rows |
| 10 | 1,000 rows | 5,000 rows | 10,000 rows |
| 25 | 2,500 rows | 12,500 rows | 25,000 rows |
| 50 | 5,000 rows | 25,000 rows | 50,000 rows |
| Unlimited (5 years) | 5,000+ rows | 25,000+ rows | 50,000+ rows |
Each revision stores the full post content. On content-heavy sites, limiting revisions and cleaning up old ones can reduce your wp_posts table by 90% or more.
Get access to all 147 modules with a single license