WordPress content management system comes with prebuilt post revision functionality. It’s a system that keeps the record of each added publication or draft made on your WordPress based website.
With this system you are capable of seeing all the changes and amendments you have done or changed in this or that revision, what remained unchanged, etc. It means that WordPress grants you with revision controls over your pages and posts whenever needed.
Or there may be cases when you will need to undo some changes previously made. In this case, post revision system will also assist you. All in all, having all the data showcasing the changes of your earlier posts is preferred to correct major errors, bring back the deleted one and more.
But what if you are working on a limited database and want to keep your website fast and quick performing all the time? The wisest decision you can make in relation to post revisions is to limit them.
Each revision made will inevitably increase your database site and during some time you can find your website running at a slower pace than usual. Hence, we offer you to take advantage of the technique to limit WordPress post revisions and highly contribute to the optimization of your WordPress website.
Even if you are making small changes each time, by default, WordPress will store those revisions and during a time it can compile dozens or even hundreds of copies of your original post. In order to help you limit WordPress post revisions, we’ll present how to manage and control your post revisions and keep your workload lighter and faster.
First, you need to go to the root file of your WP site, where you can find wp-config.php file located. Back up this file and go on with inserting the following link:
10 means that maximum 10 post revisions will be created, together with another one for autosave. Set this number as you wish. Adding this line of code into your wp-config.php file will make WordPress keep only the limited number of post revisions and delete the older ones.
Another coding line that might help you is the following:
define('AUTOSAVE_INTERVAL’, 300); // seconds define('WP_POST_REVISIONS', 10)
As you can guess, we are also changing the autosave interval of 1 minute with 300 seconds, that is-5 minutes.
As for the spot it should be located, it is above “ABSPATH”.
Finally, save your wp-config.php file and upload it back to your server. Now your post revisions are limited to 10 (according to the code below) or any other number you will set.
Alternatively, you can choose not to limit WordPress post revisions, but disable them. In order to disable this functionality, you need to follow the instructions set for the limitation. The only thing that is different is the line of code. This time it runs as follows:
If you choose to completely switch off WP post revisions for your site, there will remain only one autosave on a per post basis.
If you feel uncomfortable with going around the above offered methods because of little coding, you can use relevant plugins to limit WordPress post revisions and generally supervise how WP post revisions are handled.
Actually, there are handy plugins to suggest a simpler work around WP post revisions and are custom built to keep your database work well organized.
1. WP Revisions Control:
This simple yet effective plugin gives the WP user more control over post revisions. Install and activate WP Revisions Control and go to Settings, Writing to manage offered settings. Scroll the page until you reach to WP Revisions Control section. It will offer you to set the number of revisions to save for each post type listed. As soon as you set the relevant numbers for revisions of each post type, click Save Changes and that’s all.
2. Optimize Database after Deleting Revisions:
Optimize Database after Deleting Revisions is a one click database tool to keep it clean and optimized. It comes with an avalanche of controls and settings to give you boundless domination to limit WordPress post revisions and delete the useless ones.
Additionally, this useful plugin deletes trashed posts, pages and comments, unused tags, etc., as well as is responsible for the optimization of the database tables.
You are free to use Optimize Database after Deleting Revisions manually or use the Scheduler, in which case the optimization will run automatically. If you want to delete all revisions, but keep them for certain posts or pages, you need to create custom field as ‘keep_revisions’ for that post/page and use the value ‘Y’ for that.
3. WP Revisions Limit:
Another useful tool at your fingertips to optimize your site’s functionality and keep your database clean is launched as WP Revisions Limit. By the application of this useful and easy to understand plugin, deciding the limitation for your WP site post revisions will be simpler than you have ever thought about it to be.
As soon as the plugin is installed, activated and is ready to go, head over Settings, Revisions Limit, Revisions Options in your WP Dashboard and set the number of revisions you want to save for posts or pages.
4. WP Revision Master:
It is another handy tool to be exercised on your WP website to make the most out of your post revisions. It is bundled with a wide variety of much needed tools to disable post revision functionality or to limit it. Some of the most applicable features: disable post revisions, limit post revisions for each post type, every post, or for the entire website, trash revisions, possibility to restore an old version, advertisement free working platform and much more. With this plugin you can also enable post revisions to custom post types.
WP Revision Master is in full compliance with the latest versions of WordPress, is well supported and foresees future updates with additional functions.