Quick answer: WordPress saves a revision every time you update a post or page, and autosaves your work every 60 seconds while you edit. By default it keeps every revision forever, which can bloat the database on busy sites. You can limit how many revisions are kept by adding define( 'WP_POST_REVISIONS', 5 ); to wp-config.php, and clean out old ones with a plugin such as WP-Optimize or with WP-CLI. Always take a full database backup first.
Revisions are one of WordPress’s quiet strengths. If someone deletes a paragraph by mistake or a plugin mangles a page, you can go back to an earlier version in a couple of clicks. But a site that has been edited heavily for years may have tens of thousands of stored revisions that nobody will ever use.
How revisions work
When you click Update on a post or page, WordPress stores a copy of the previous version as a separate row in the wp_posts table, with the post type revision. Each copy includes the title, content and excerpt.
On the edit screen, the Revisions link in the Publish box opens a comparison screen. You can slide between versions, see what changed and restore any of them.
Revisions are enabled for posts and pages by default. Custom post types can opt in when they are registered.
How autosave works
While you are editing, WordPress automatically saves your work in the background, by default every 60 seconds.
- For a draft that has not been published, the autosave updates the draft itself.
- For a published post, it creates a special autosave revision so your live content is not changed until you click Update.
- WordPress keeps only one autosave per user per post, so autosaves do not pile up the way revisions do.
If your browser crashes or you lose your connection, WordPress will offer to restore the autosaved version next time you open the post. Recent versions also keep a backup in the browser’s local storage, which helps if the connection drops before an autosave reaches the server.
Why revisions can become a problem
On most small sites, revisions are harmless. They become an issue when:
- Content is edited often. Sites with many authors or frequent updates collect revisions quickly.
- Posts are long. Each revision stores the full content, not just the change.
- Page builders are used. Some builders save large amounts of content and data with each update.
- The site has been running for years with no clean up.
The result is a larger database. That means bigger backups, slower exports and migrations, and in some cases slower admin screens. Front end page speed is rarely affected much by revisions alone, because WordPress does not load them when showing pages to visitors. Do not expect a dramatic speed boost from cleaning them, but a lean database is easier to look after.
Limiting revisions
You can control how many revisions WordPress keeps in wp-config.php. Add the line above the comment that says “That’s all, stop editing!”.
Keep a set number
define( 'WP_POST_REVISIONS', 5 );
WordPress will keep the five most recent revisions for each post and remove older ones when new revisions are saved. Five to ten is a sensible number for most sites.
Turn revisions off
define( 'WP_POST_REVISIONS', false );
We do not usually recommend this. Revisions are a cheap safety net, and removing them completely means there is no way back after a mistake.
Change the autosave interval
define( 'AUTOSAVE_INTERVAL', 120 );
This sets the interval in seconds. Raising it slightly can reduce server requests on busy editorial sites, but the default is fine for most.
Note that setting a limit does not remove existing revisions straight away. Older revisions for a post are trimmed the next time that post is updated.
Cleaning up old revisions
Back up first
Before any database clean up, take a full backup and confirm you can restore it. Deleting revisions cannot be undone.
Using a plugin
Plugins such as WP-Optimize and WP-Sweep can remove revisions, along with other clutter such as spam comments, trashed posts and expired transients. Look for options to keep a number of recent revisions or revisions from the last few weeks, rather than removing everything.
Run the clean up, check the site, then deactivate or schedule the plugin as you prefer.
Using WP-CLI
If you manage the server, WP-CLI is quick and precise. You can list revisions with:
wp post list --post_type=revision --format=count
and remove them with a combination of WP-CLI commands. Test on a staging copy first.
Using SQL
You can also delete revisions directly in the database, but this needs care. Revisions can have related rows in the postmeta and term relationship tables, and a careless query can leave orphaned data or remove the wrong rows. Use a plugin or WP-CLI unless you are confident with SQL and have a backup.
Optimising tables afterwards
Deleting rows does not always shrink the database files straight away. Running an optimise on the affected tables, which most clean up plugins offer, reclaims the space. On large sites, do this at a quiet time, as it can briefly lock tables.
Other sources of database bloat
Revisions are only one cause. While you are cleaning up, also check:
- Transients: temporary cached data that plugins store in the options table. Expired ones are usually safe to remove.
- Autoloaded options: data loaded on every page request. Plugins that were removed may have left large autoloaded options behind.
- Spam and trashed comments.
- Leftover tables from plugins you no longer use.
- Log tables from security or form plugins, which can grow very large.
Autoloaded options and oversized log tables are more likely than revisions to affect speed. Our WordPress speed optimisation guide covers database and hosting causes of slowness in more detail.
Revisions on multi author sites
On sites with several editors, revisions do more than protect against mistakes. The comparison screen shows who changed what and when, which helps when a page suddenly looks different and nobody remembers editing it. For this reason, editorial teams often keep a higher limit, such as 20 or 30, while small business sites managed by one person can keep fewer. Choose a number that matches how many people edit content and how far back you might realistically need to go.
A sensible routine
- Set
WP_POST_REVISIONSto a reasonable number, such as 5 or 10. - Take a full backup.
- Clean out old revisions and other clutter once.
- Optimise the tables.
- Schedule a light clean up every few months, or after major content projects.
Pair this with regular updates and backups as part of general site maintenance. Our WordPress security guide explains why backups and updates go hand in hand.
FAQ
Will deleting revisions affect my live content?
No. Revisions are copies of earlier versions. Your published content is stored separately. You do lose the ability to restore those older versions, which is why a backup comes first.
Do revisions slow down my website?
Rarely in a noticeable way for visitors. They mainly affect database size, backups and some admin screens.
Can I keep revisions for some post types and not others?
Yes. A developer can use the wp_revisions_to_keep filter to set different limits per post type.
Want a WordPress site that stays tidy?
We look after WordPress sites with regular updates, backups and database maintenance, so problems are caught early. See how we help businesses turn visitors into customers with sites that stay fast and stable.