Around the Optimize the performance of your WordPress website, it is important to limit the number of revisions saved for each post or page.
By default, WordPress saves every change made to content, which can lead to a bloated database over time. By setting a maximum number of revisions, such as five, you can significantly reduce the database size and improve your site's loading times.
Limit revisions
Why are WordPress revisions a problem?
WordPress automatically saves a revision every time you update a post or page. This is a useful feature that allows you to revert to previous versions of content. If you make a mistake or want to undo changes, you can easily restore an older version.
However, this feature also has its downside: Too many revisions unnecessarily bloat the database, which can negatively impact your website's performance. The more posts and pages you have, the more serious this problem becomes. For example, 200 posts with 10 revisions each can quickly lead to 2,000 additional entries in your database, which increases loading times and complicates administration.
How can you effectively limit or disable WordPress revisions?
The good news is: You can easily limit the number of saved revisions in WordPress or even disable them completely. In this post, I'll show you how to do this – both via a plugin and by manually adjusting the wp-config.php file.
1. Limit revisions: Keep the database lean
To prevent your database from becoming unnecessarily bloated due to too many revisions, you can limit the number of revisions saved per post or page. To do so, simply add the following code to your wp-config.php file:
// Limit revisions to 3
define('WP_POST_REVISIONS', 3);
This code ensures that WordPress only saves the last three revisions of each post. You can, of course, adjust this number to your needs, although a value of 3 to 5 is sufficient in most cases.
2. Completely disable WordPress revisions
If you don't need revisions and want to keep your database as lean as possible, you can disable revisions completely. However, be aware that you'll no longer be able to revert to older versions of a post.
To disable revisions, add this code to wp-config.php:
// Disable revisions
define('WP_POST_REVISIONS', false);
Despite this setting, old revisions will still be stored in your database. To delete them manually, you can use a plugin or delete them directly from the database (see below).
3. Delete WordPress revisions: Free your database from old data
Delete via plugin: The easiest way to get rid of old revisions is to use a plugin. Tools like WP sweep or WP Optimize offer an easy way to remove unnecessary revisions with just a few clicks. Many caching plugins like WPRocket also have a function to delete revisions.
Manual deletion via the database: For technically savvy users, there is the option to delete revisions directly from the database. This requires access to phpMyAdmin and executing an SQL command:
DELETE FROM wp_posts WHERE post_type = 'revision';
Make sure to create a backup before making any changes to the database!
4. Conclusion: Optimization made easy
Limiting or disabling WordPress revisions is a simple and effective way to improve your website's performance. While plugins offer a quick fix, adjusting the wp-config.php file allows for long-term optimization. If you regularly maintain your WordPress installation, you'll benefit from a lean database and noticeably improved performance.
For Litespeed Cache
Specifically for Litespeed Cache, the plugin offers an option to limit revisions. You can find this under Database:

Then click on DB Optimization Settings:

To disable revisions, set both values to 0.
Frequently asked questions about WordPress revisions
Why should I limit revisions in WordPress?
Limiting revisions in WordPress is useful for improving site performance and efficiency. Each revision saves a previous version of a post or page, which can lead to excessive data accumulation in the database. This puts strain on the database, slows queries, and can even increase backup size and time. By limiting the number of saved revisions, you reduce the load on the database and ensure your WordPress installation remains faster and leaner, without unnecessary baggage from old versions.
What happens if I disable revisions?
You'll no longer be able to access previous versions of your posts. However, existing revisions will remain in the database until you manually delete them.
What is the maximum number of revisions I should save?
In most cases, 3 to 5 revisions per post are sufficient. This keeps the database lean without sacrificing functionality.
Which plugin is best for revision cleanup?
WP-Sweep and WP-Optimize are two of the best tools to delete unnecessary data such as revisions, transients, and unused metadata.
Done! That was easy, wasn't it?