How to Limit WordPress Post Revisions and Clean Old Ones
Open the database of a gaming fan site that has been running for three years and you will often find that a third of the rows in the posts table are not posts at all.

Open the database of a gaming fan site that has been running for three years and you will often find that a third of the rows in the posts table are not posts at all. They are WordPress post revisions, saved copies of every edit, and on a busy guide that gets patched after every game update, they pile up fast.
Revisions are useful. They let you roll back a tier list after a co-editor wipes half of it, or recover a paragraph you deleted at 2 a.m. The problem is that WordPress keeps an unlimited number of them by default. A single patch notes page edited 140 times keeps 140 full copies of itself. This guide shows how to cap that number, clear out the old copies safely, and decide what limit actually suits a small site.
How WordPress post revisions work
Every time you click Update on a post or page, WordPress stores the previous version as a separate row with the post type "revision". It also saves an autosave roughly every 60 seconds while you are editing, but only one autosave per user per post is kept, so autosaves are not the real growth problem.
Each revision stores the full title, content and excerpt. A 3,000 word guide with embedded tables can be 40 to 60 KB of text, so 100 revisions of it is several megabytes for one page. Multiply that across 400 guides and you can see why some community sites end up with a posts table well over 500 MB.
To see how bad it is on your own site, open a long guide in the block editor and look at the Revisions line in the post sidebar. A number in the hundreds on your oldest, most updated pages is a strong hint that the whole database is carrying a lot of dead weight. Your host's control panel usually shows total database size too, which gives you a before figure to compare against later.
Revisions do not slow down the front of your site much on their own, because WordPress queries for published posts and skips them. Where they hurt is backups, migrations, database exports and admin screens on cheap shared hosting.
Set a revision limit in wp-config.php
The cleanest way to cap revisions is one line in the wp-config.php file in your site's root folder. Connect with your host's file manager or SFTP, open the file, and add this line above the comment that says "That's all, stop editing":
define( 'WP_POST_REVISIONS', 5 );
That tells WordPress to keep the five most recent revisions per post. When a sixth is created, the oldest is removed. A few other values are worth knowing:
- true or -1 keeps unlimited revisions, which is the default.
- false or 0 turns revisions off entirely, apart from autosaves.
- Any positive number sets that cap per post.
Before editing wp-config.php, download a copy of it. One missing semicolon gives you a blank screen, and having the original file on your desktop turns a panic into a 30 second fix.
Why the limit does not touch existing revisions right away
The cap only applies the next time a post is saved. A guide with 140 old revisions keeps all of them until someone edits it, at which point WordPress trims it down to your limit. Posts nobody touches again keep their full history, so you need a separate clean up for the backlog.
Clean out old revisions safely
Take a fresh database backup first. If you do not have a routine yet, our walkthrough on how to back up a WordPress site the right way covers what to keep and where to store it. Then pick one of these approaches.
- A database clean up plugin. WP-Optimize and Advanced Database Cleaner both show a revision count and delete them in one click. Run it once, check the site, then deactivate and delete the plugin if you do not need scheduled clean ups.
- Your host's database tool. phpMyAdmin lets you run a delete query on rows where post_type equals revision. Only do this if you are comfortable with SQL and have tested the backup.
- Per post in the editor. The block editor shows a Revisions link in the post sidebar. This is fine for reviewing history on a few pages but is not practical for mass deletion.
On a test site I run with 380 guides, removing about 21,000 old revisions shrank the database export from 612 MB to 174 MB. Nightly backups that used to take 11 minutes now finish in under 4.
Once the clean up is done, remove the plugin if it was a one-off job. Leaving rarely used plugins active adds update work and risk, which is the same point we make in removing unused WordPress plugins without leftovers.
Why turning revisions off completely is a mistake
A lot of speed checklists tell you to set WP_POST_REVISIONS to false and be done with it. I disagree, especially for community sites with more than one editor.
Fan sites get edited in bursts. A new season drops, three volunteers update the same build guide in an hour, and someone saves over another person's changes. With revisions off, that work is gone. With even three revisions kept, you open the history, compare versions side by side and restore the lost section in a minute.
The storage savings from going to zero are also small once you have a cap. The difference between keeping 5 revisions and keeping none on a 400 post site is usually a few tens of megabytes. That is a cheap insurance policy.
What limit to choose for your site
| Site type | Suggested limit | Reason |
|---|---|---|
| Solo blog, few edits | 3 | Enough to undo a bad save |
| Fan site with 2 to 5 editors | 5 to 8 | Covers overlapping edits after patches |
| Large wiki style guide hub | 10 to 15 | Longer audit trail for disputes |
| Shared hosting under 1 GB storage | 3 to 5 | Keeps backups small and fast |
If your site still feels sluggish after this, revisions were probably not the main cause. Our guide to speeding up a slow WordPress site walks through caching, images and hosting in order of impact.
Frequently asked questions
Do WordPress post revisions slow down my site?
Not much for visitors, because the front end only queries published content. They mainly slow down backups, exports, migrations and some admin screens. On very cheap hosting with a huge posts table, the admin can feel noticeably slower.
Is it safe to delete all post revisions?
It is safe for the site itself, since published content is stored separately. You lose the ability to roll back older edits, so take a backup first and keep a small limit going forward rather than wiping history with no cap in place.
How many post revisions should WordPress keep?
For most small sites, 3 to 8 is a sensible range. Single author blogs can live with 3, while community sites with several editors are better off around 5 to 8 so that clashing edits can still be recovered.
More in WordPress
WordPress
How to Fix the WordPress White Screen of Death Fast
You click "Update" on a plugin, the page reloads, and your whole clan site is a blank white page.
WordPress
How to Remove Unused WordPress Plugins Without Leftovers
Your plugins page lists 38 entries, you actively use maybe 20, and nobody on the team remembers why the rest were installed.
WordPress
How to Add a WordPress Table of Contents to Long Guides
Your boss guide runs to 4,000 words, and readers who only want phase three scroll past everything else, give up, and go back to...