How to limit or disable WordPress revisions

Cpanel Login

In this article I am going to show you how to limit or disable your WordPress revisions. WordPress offers a great functionality in revision control. Whenever you were writing a blog post, WordPress automatically saves your edits which will allows you to go back and see your previous edits. This might help you when something wrong happens while you were writing your blog post you can automatically recall your previous edits. But over the course, if the number of blog posts in your blog increases, the number of revisions also increases. This will increase the size of your database and may pose problems to your blog’s performance.

For example when writing an article in your WordPress, if you made little changes to your blog post, and previewed your blog post, WordPress will automatically save that edit as a revision. If you again, make a small change and previewed your article, it will again save that little edit as another revision. In a single revision, WordPress will save the entire post. So, if your WordPress post has around 20 revisions means, it will save the same post with little changes like 20 times. This will take a lot of space in your database. Eventually when your database grows, if each of your database has around 20 revisions, it will take up a lot of space in your database. So, that’s why many people want to limit or disable WordPress revisions in their website which will helps in saving their database space and also increases their blog’s performance.

Below are the steps on how to limit WordPress revisions:

Step 1:

Login to your CPanel, by entering your CPanel username and password.

Step 2:

Go to your File Manager > and Edit the file wp-config.php

Step 3:

Now, enter the following code to the file wp-config.php

define(‘WP_POST_REVISIONS’, 3);

After you have added the above code to your file wp-config.php, click on save changes to save the changes you made to your wp-config.php file.

This is how my wp-config.php file looks like.

With the above setting, now your revisions for your WordPress posts are limited to only 3. From now on, WordPress only saves up to 3 revisions, this will help in saving your database space and also gives you better performance.

How to Disable WordPress revisions:

You can also disable WordPress revisions completely in your WordPress if you don’t want revisions at all for your blog posts.

You can disable revisions completely with WP_POST_REVISIONS in your WordPress, by editing wp-config.php file like you did for limiting the WordPress revisions in the above.

Here are the steps on how to disable WordPress revisions.

Step 1:

First, login to your Cpanel with your Cpanel login details.

Step 2:

Go to your File Manager of your blog in which you want to disable post revisions. Now, click on wp-config.php to edit it in your file manager.

Step 3:

Now enter the following code in your wp-config.php file.

define(‘WP_POST_REVISIONS’, false);

By adding the above line of code to your wp-config.php, it will disables the post revisions in your WordPress blog. After adding the code to your config file, click on Save to save the changes that you made to your file.