WordPress Post Revisions:

Post Revision is a feature in WordPress which saves your post content periodically. It saves the revisions of posts, pages or custom post types automatically after every 60 seconds while a user is working on it. These post revisions take space in your database. If you have hundreds of posts, then hundreds of revisions will be stored too. The post revisions are useful to prevent data loss from any accidental damages like power outages or browser crashes. It also improves the editorial workflow.

A single post might have more copies in the database. It can directly increase the database size and slows down the speed. The website speed can be increased by keeping the database optimized. We can either limit post revisions or disable them to maintain a healthy website and keep the database optimized. In this article, let us see how to limit and disable post revisions through cPanel without using any plugins.

How to Limit Post Revisions Using cPanel?

The Post Revisions can be limited to a minimum number instead of keeping as unlimited or disabling them. It can be set to a minimum number like two or three to limit the maximum number of revisions stored in the database. It can be done simply by editing the wp-config.php file. Let us see the below steps to limit Post Revisions in cPanel.

Step 1: Open your cPanel account and navigate to the section File Manager. It is the location where all the website files will be present in the cPanel.

Step 2: Open root directory and select the folder ‘public_html’. This is the default folder used to store website files. Public_html

Step 3: Identify the file ‘wp-config.php’ and then right-click on it to edit the file.edit

Step 4: A popup appears and asks to disable encoding. Just, click on the Edit button a new tab opens up in the browser.Edit-config

Step 5: A lot of coding lines will appear in the config.php file. Just, add the below line of code and then click on Save Changes.

define('WP_POST_REVISIONS', 3);

In the above line, Post Revisions are limited to a number like 3. Thus, only three recent drafts of the blog posts will be available in it.

How to Disable Post Revisions?

When the website is big with thousands of posts or if the database size increases, then you need to disable the Post Revision feature in WordPress. It will be helpful to maintain a faster website. Follow the same steps as mentioned above to edit wp-config.php file and add the below line of code.

define('WP_POST_REVISIONS', false);

The code is a little bit different, instead of a number, you have to fill in “false.” 

Click on the option Save Changes. Now, the Post Revisions are disabled successfully.

Thus, database optimization can improve website performance. WordPress users can either limit or disable Post Revisions as per their choice. Adding a line of code helps to maintain a faster loading time easily without the use of any plugins. For more information, follow us on Facebook and Twitter. For video tutorials, subscribe to our YouTube Channel “ServerCake India“.