In one of my previous posts, I wrote how to disable WordPress Revisions. In that article, I also wrote about the importance of revisions. Revisions help a lot in recovering the post content if you did some wrong changes and saved. So, I don’t recommend you to disable WordPress Revisions. If you are worried about storage and performance of your blog, you can limit the WordPress revision.
Yes, WordPress also allows you to set the number of maximum revisions you want in your WordPress blog. With this way, you will not be disabling the revisions but limiting it to keep storage optimized. In this article, I will write steps to limit number of WordPress revisions.
Also read: Optimize database of WordPress blog
How to Limit Number of WordPress Revisions
It requires the access to files. You can either use cPanel’s file manager, FTP or any other panel if you have installed on your hosting to manage your hosting and files.
Step 1: Access the root of your WordPress site directory. You can do it using the file manager of hosting software or FTP.
Step 2: Open the wp-config.php file in edit mode. I recommend you to first download this file to avoid any issue if you made wrong changes.
Step 3: Add the code given below and save the file. Add it above the ‘ABSPATH’ otherwise, it won’t work. The below code is for 3 revisions. You can change this number as per your interest.
In case your WordPress website stops opening and you see a white page of PHP error page, you may have done something wrong. You can reupload the original file you downloaded before editing.
WordPress revisions helps a lot but having too many revisions makes database large and ultimately affect the load time. If you have thousands of posts, you will see considerable effect of large number of revisions. So, limiting the number of WordPress revisions will surely help you a lot.