Disable Post Revisions in WordPress and Optimize Database Size
WordPress provides one of the great feature called Post Revisions which maintains the revision history of your posts when you update and save the post multiple times. But having this feature enabled also has a disadvantage for the users who has limited database space. For those users who has less Database size and don’t need autosave feature can Disable Post Revisions in WordPress. This way they can get reduce their database size and speed up the site.
Disable Post Revisions in WordPress
To turn off post revision in WordPress login to your FTP account and find the wp-config.php in the root folder of your WordPress installation and add the following lines of code.
/** Disable future revisions and increase autosave interval to 300 seconds */
define('AUTOSAVE_INTERVAL', 300 ); // time in seconds
define('WP_POST_REVISIONS', false );
The above code will disable the POST revision for all the future posts you create and also increase the time interval of autosave from 60 seconds to 300 seconds which is 5 minutes time.
Note: This will not remove the revisions of the posts that you already created and you need to remove it manually. If you are familiar with MySQL database than login into PHPMyAdmin area and run the below SQL Query to remove all the revisions.
DELETE FROM wp_posts WHERE post_type = "revision";
We do not recommend to disable Post revisions feature completely as you might not be able to save any revision history. But if you want to limit the revisions history to limit to some number instead of disabling that might be the best option.
Limit WordPress Post Revisions Count
You can limit the WordPress posts revisions count to any number you want like 3 or 5. By limiting the post revision count only limited no of latest revisions will be preserved.
Add the below line to the wp-config.php file to restrict the Post revisions count.
define('WP_POST_REVISIONS', 3); // This will save only 3 latest revisions of the POST
If you are not a technical expert and has not used MySQL or PHP then the best option is to use a plugin like WP-Optimize which takes care of everything. WP-Optimize is very effective and popular plugin which you could use to optimize the database completely. It has many other several features which will help you to increase the performance of your website.