WordPress has a built in revision system that stores each saved draft or post update. This is super handy but also flawed at the same time. Over time, these WordPress revisions can really add up to a lot of space in your database. I recommend you delete WordPress revisions on a regular basis to keep your database clutter free.
Let’s say you started writing a new post, previewed it, made seven more draft saves, then published. Even though each revision may have only been a word or two, you’ve just added 10 full-length copies of your post in the database (one of which is an autosave).
How to limit the number of post revisions in your WordPress database with a plugin
I recommend downloading the Better Delete Revision plugin for WordPress to clean up old post revisions. It’s as simple as clicking a button! This plugin also has an additional feature of optimizing your database (which you should do after deleting WordPress post revisions). See below for an example WordPress blog which has never deleted any revisions.. ouch!
How to automatically limit the number of post revisions in your WordPress database
WordPress has set up a handy little line of code that limits the number of post revisions store for any given post. Edit your wp-config.php file and add the following line:
define( ‘WP_POST_REVISIONS’, 3 );
This will tell WordPress to store a maximum of three revisions per post (which is actually four, counting the autosave). If you want more than three, just change to a number you’re comfortable with.
Alternatively, if you don’t want WordPress to store any revisions, add this line instead:
I hope that helps! If you installed the Better Delete Revision WordPress plugin, how many revisions did you delete?