WordPress Revisions: Control, Limit, and Clean Up Your Posts
If you’ve spent any time editing content in WordPress, you’ve likely noticed the “Revisions” section under your posts or pages. WordPress automatically saves each change you make, which can be a lifesaver. However, over time, these revisions can clutter your database and impact site performance. Let’s dive into how you can enable, disable, limit, and delete WordPress revisions to keep your website running smoothly.
What Are WordPress Revisions?
WordPress revisions are snapshots of your post or page at different points in time. Every time you click “Save Draft” or “Update,” WordPress stores a copy. You can review, compare, and revert to these earlier versions if needed. Learn more about Revisions from WordPress.org.
While revisions are incredibly useful for writers and editors, they can become a problem when stored in excess. A cluttered database can slow down your site’s performance and complicate backups.
How to Enable WordPress Revisions
Good news: revisions are enabled by default in WordPress. If your site doesn’t seem to be saving revisions, it may have been disabled manually. To re-enable it:
- Access your website’s wp-config.php file via FTP or your hosting panel.
- Add or update this line:
define('WP_POST_REVISIONS', true);
This ensures that WordPress continues saving revisions as you work.
How to Disable WordPress Revisions
If you want to disable revisions entirely (not recommended for active content creators), you can modify the wp-config.php file:
define('WP_POST_REVISIONS', false);
Important: Disabling revisions stops new ones from being saved, but it won’t delete existing ones. You’ll need to remove old revisions separately.
How to Limit WordPress Revisions
Rather than disabling revisions completely, a smarter approach is limiting the number saved per post. This keeps the convenience without bloating your database.
To set a limit, add this line to your wp-config.php file:
define('WP_POST_REVISIONS', 5);
This example allows only the latest five revisions to be stored for each post.
WPBeginner offers a helpful guide on why and how to limit revisions.
How to Delete Existing WordPress Revisions
If your database already has thousands of revisions, you can clean them up easily.
Option 1: Use a Plugin
Plugins like WP-Optimize or Advanced Database Cleaner allow you to delete revisions with a few clicks. They also let you schedule automatic cleanups.
Option 2: Run a SQL Query
For those comfortable with database management, you can run a direct SQL command in phpMyAdmin:
DELETE FROM wp_posts WHERE post_type = "revision";
Caution: Always back up your database before making direct changes!
Best Practices for Managing WordPress Revisions
- Limit, don’t disable: It’s better to limit revisions rather than turn them off entirely.
- Backup first: Always create a full backup before modifying your database.
- Use plugins carefully: Choose reputable plugins with good reviews and active support.
- Schedule cleanups: Regularly tidy up your database to maintain site speed.
WordPress revisions are a fantastic safety net when managed well. By understanding how to enable, disable, limit, and delete revisions, you can enjoy the benefits of version control without the downsides of database bloat.
Further Reading:
- Official WordPress Revisions Documentation
- WPBeginner’s Guide to WordPress Revisions
- Kinsta’s Database Optimization Tips