WordPress saves post revisions every time you edit a page or post.
These are backup versions that help you restore changes if something goes wrong. While useful, they can quickly build up in your database.
Too many revisions increase the database size and can slow down your website over time. This can affect performance, backups, and overall site speed.
In this guide, you’ll learn how to safely remove post revisions, reduce database bloat, and keep your WordPress site running smoothly.
Learn how to keep your database fast in our WordPress database performance optimization guide.
What Are WordPress Post Revisions?
WordPress post revisions are saved versions of your content that track every change you make to a post or page, allowing you to go back to an earlier version if needed.
Each time you click “Save Draft,” “Update,” or even edit content for a while, WordPress creates a revision in the background to protect your work.
In addition, WordPress uses autosave, which automatically saves a temporary version of your content at regular intervals (typically every 60 seconds) to prevent data loss if your browser crashes or your connection drops.
The key difference is that autosaves are limited and overwrite previous autosaves, whereas revisions are permanent records that accumulate over time.
All of these revisions are stored in your WordPress database, specifically in the wp_posts table where each revision is saved as a separate entry linked to the original post.
As your site grows, these entries can accumulate quickly, increasing database size and making queries less efficient, which is why managing them becomes important for performance.
Why You Should Remove Post Revisions
Reduce Database Size
Each revision is stored as a separate entry in your database, and these entries accumulate quickly. A single post can have dozens of revisions if it’s edited often.
Multiply that across your entire site, and your database becomes unnecessarily large.
Removing old revisions removes excess data, making your database lighter and easier to manage.
Improve Website Performance
A bloated database slows WordPress’s data retrieval and processing. This can affect page load times, especially on larger sites.
By removing unnecessary revisions, you reduce the amount of data your server must process. This helps your site run faster and more efficiently without changing your content.
Faster Backups and Restores
The larger your database, the longer it takes to create backups. This also increases storage usage and can slow down restore times when something goes wrong.
Cleaning out revisions reduces the size of your backups, making them quicker to generate and easier to restore when needed.
Better Database Management
A clean database is easier to maintain and troubleshoot.
When unnecessary revisions are removed, it becomes simpler to manage tables, run optimizations, and identify real issues.
This keeps your WordPress setup organized and reduces the risk of performance problems over time.
When You Should NOT Delete Revisions
Situations Where Revisions Are Useful
Post revisions are valuable when multiple people work on the same content. They let you track changes, compare versions, and restore earlier edits if something goes wrong.
This is especially helpful for teams, client work, or long-form content that undergoes multiple revisions.
Revisions also act as a safety net during editing.
If you accidentally delete content or make a mistake, you can quickly roll back to a previous version without starting over.
Risks of Removing Them Completely
Deleting all revisions removes your ability to recover past versions of your content. Once they are gone, you cannot undo major changes or restore older drafts.
This can be risky if you frequently update posts or experiment with content.
It also means that accidental edits or data loss cannot be easily reversed, which may result in lost work or time spent rebuilding content.
Best Practice: Limit vs Delete
Instead of removing revisions entirely, it is better to limit the number of revisions stored.
This keeps your database clean while still allowing you to access recent versions when needed.
Setting a limit (e.g., 3-10 revisions per post) strikes a balance between performance and safety.
You reduce database bloat without losing the ability to recover important changes.
How to Delete Post Revisions in WordPress
There are three main ways to remove post revisions in WordPress. The best method depends on your skill level. Beginners should use plugins, while advanced users can use manual or command-line methods for more control.
Method 1: Using a Plugin (Beginner-Friendly)
Recommended Plugins
Popular and trusted plugins for removing revisions include:
- WP-Optimize – all-in-one cleanup and performance plugin
- Advanced Database Cleaner – more control over what gets deleted
- Optimize Database after Deleting Revisions – simple one-click cleanup
These plugins can safely remove revisions, clean unused data, and schedule automatic cleanup tasks.
Step-by-Step Instructions
- Go to your WordPress dashboard
- Navigate to Plugins → Add New
- Search for WP-Optimize or Advanced Database Cleaner
- Install and activate the plugin
- Open the plugin settings (usually under “WP-Optimize” or “Database Cleaner”)
- Select Post Revisions from the cleanup options
- (Optional but recommended) Check the option to create a backup
- Click Run Optimization / Clean Up
Most plugins also allow you to schedule automatic cleanups, either weekly or monthly, to keep your database optimized.
Pros and Cons
Pros:
- Easy to use with no technical knowledge
- Safe cleanup with preview and backup options
- Can automate future cleanups
- Removes other junk data (spam, drafts, transients)
Cons:
- Adds an extra plugin to your site
- Some advanced features may require a paid version
- Less control compared to manual methods
Method 2: Using phpMyAdmin (Manual Method)
Accessing Your Database
- Log in to your hosting account (cPanel or similar)
- Open phpMyAdmin
- Select your WordPress database (usually starts with
wp_) - Click on the SQL tab
This gives you direct access to your database tables.
SQL Query to Delete Revisions
Run the following query:
DELETE FROM wp_posts WHERE post_type = 'revision';
This will remove all post revisions from your database instantly.
Important Precautions
- Always back up your database first before running any SQL queries
- Make sure your table prefix is correct (it may not always be
wp_) - Double-check your query before executing
Deleting data manually is powerful but risky. A mistake can break your site or remove important content.
Method 3: Using WP-CLI (Advanced Users)
Command to Delete Revisions
If you have SSH access, you can run:
wp post delete $(wp post list --post_type='revision' --format=ids)
This command finds all revisions and deletes them in one step.
When to Use WP-CLI
- You manage multiple WordPress sites
- You prefer command-line tools
- You want faster bulk operations
- You are comfortable using SSH
WP-CLI is commonly used in development and staging environments to improve efficiency and automate tasks.
Benefits for Developers
- Fast and efficient for large databases
- Can be scripted and automated
- No need to log into the WordPress dashboard
- Ideal for server-level management
How to Limit Post Revisions Instead of Deleting
Deleting revisions removes them completely, but limiting them is often the smarter approach.
You keep recent backups while preventing your database from growing out of control. This gives you both safety and performance.
Limit Revisions via wp-config.php
Code Snippet
define('WP_POST_REVISIONS', 5);
How It Works
This line tells WordPress to store only a fixed number of revisions per post. In this case, it keeps the latest 5 revisions and automatically deletes older ones as new edits are made.
This prevents unlimited buildup without removing your ability to restore recent changes.
To apply this, open your wp-config.php file (found in your WordPress root directory) and add the code above.
Place it just before the line that says “That’s all, stop editing!”. Save the file and upload it back to your server if needed.
This method runs automatically in the background. You don’t need plugins or manual cleanup once it’s set.
It’s one of the most efficient ways to control database size over the long term.
Disable Revisions Completely (Optional)
Code Snippet
define('WP_POST_REVISIONS', false);
When This Is Appropriate
This setting completely disables post revisions. WordPress will no longer store any revision history for your posts or pages.
This can significantly reduce database usage, especially on sites with frequent edits.
However, this option should be used carefully. It is best suited for:
- Single-author websites
- Sites with minimal content updates
- Projects where version history is not important
Avoid disabling revisions on multi-author sites or blogs where content changes often. Without revisions, you cannot recover previous versions if something goes wrong.
Best Practices for Managing Post Revisions
Always Back Up Your Database Before Changes
Before deleting or limiting revisions, create a full database backup. This protects your content in case something goes wrong.
Use your hosting backup tool or a trusted plugin to generate a backup in a few clicks. Store a copy locally or in the cloud.
If an error occurs, you can quickly restore your site without losing data.
Set a Reasonable Revision Limit (3–10)
Avoid keeping unlimited revisions. Instead, set a practical limit that balances safety and performance. A range of 3 to 10 revisions per post is enough for most sites.
This allows you to recover recent edits while preventing unnecessary database growth. You can control this easily using the wp-config.php setting discussed earlier.
Clean Database Regularly
Even with limits in place, your database can still collect unused data over time. Schedule regular cleanups to remove old revisions, drafts, spam comments, and other clutter.
Monthly cleanups work well for most websites. This keeps your database lean and helps maintain consistent performance.
Use Optimization Plugins Wisely
Plugins can simplify database management, but overusing them can slow your site. Select a reliable optimization plugin and configure it correctly.
Avoid overlapping tools that perform the same function.
Enable only the features you need, such as revision cleanup and scheduled optimization, to keep your site efficient without adding unnecessary load.
Common Mistakes to Avoid
Deleting Revisions Without Backup
Removing revisions without a backup is risky. If something goes wrong, you cannot restore lost content.
Always create a full database backup before making changes. This provides a safety net and enables you to recover quickly if needed.
Disabling Revisions on Multi-Author Sites
Turning off revisions completely can cause problems on sites with multiple writers or editors. Revisions help track changes and fix mistakes.
Without them, you lose visibility and control over edits. For these sites, it is better to limit revisions rather than disable them.
Running Incorrect SQL Queries
Manual database cleanup requires precision. A small mistake in an SQL query can delete the wrong data or break your site.
Always double-check your query and confirm your table prefix before running it. If you are unsure, use a plugin instead of manual methods.
Over-Optimizing Database
Cleaning your database too often or removing too much data can be unnecessary. Not all stored data is harmful.
Focus on removing only what you don’t need, such as old revisions and spam. Keep essential data intact to avoid issues with site functionality or content recovery.
Final Thoughts
Managing post revisions helps keep your WordPress database clean, fast, and efficient.
Too many revisions can slow your site down, but removing or limiting them improves performance and makes backups easier.
Start by safely cleaning old revisions or setting a limit to prevent future buildup.
Then take it a step further by optimizing your full database using a trusted plugin to keep your site running smoothly.
For practical steps and tools, read the WordPress database optimization step-by-step guide.
FAQs
What are post revisions in WordPress?
Post revisions are saved versions of your posts or pages that track changes over time, allowing you to restore earlier edits.
Is it safe to delete post revisions?
Yes, it is safe if you no longer need them. Always back up your database before deleting to avoid data loss.
How many revisions should I keep?
Keeping 3 to 10 revisions per post is a good balance between performance and content safety.
Will removing revisions speed up my site?
Yes, reducing revisions can improve database performance, which may help your site run faster.
Can I recover deleted revisions?
No, once revisions are deleted, they cannot be recovered unless you restore a database backup.