How to Disable Post Revisions in WordPress and Load your Website Faster

WordPress has many by default features for the bloggers. Post revision is one of them. However, this feature will take some space of your database. Also, it may slow the loading speed of your site. So, many bloggers disable post revision to save the space. Also, to make the website faster. Especially, when you have limited space in the database, disabling the post revision is necessary. You can do this task by using some codes. If you are not willing to use codes, there are some plugins for it. This post will let you know how to disable post revision to make your website faster.

Post revision in wordpress

Why You Need Disabling Post Revision?

Though this feature has a small impact on the site loading speed, but take space in the database. If you are managing a little blog with a limited database space, it is necessary for you. When you disable the revision feature, you save a lot of space. However, you can customize the disabling way according to your necessity.

Disabling Post Revisions

If you want to disable the post revision for your WordPress site, just use the following code.

 

define( ‘WP_POST_REVISIONS’, false );

 

You need to add the code in the wp-config.php file that located in the root directory of your site. You need to add the code to the top of this file.

It will disable posts revisions from being saved to the database in the future. However, you can enable it anytime as you wish. For enabling the post revision again, you need to change the above code. Replace the previous code with-

 

define( ‘WP_POST_REVISIONS’, true );

 

Limiting Post Revision

If you want to limit the revision, you may want a different code. For example, if you want to limit the post revision for recent five posts, use the following code-

 

define( ‘WP_POST_REVISIONS’, 5 );

 

You need to add this code to the wp-config.php file. This will save 5 most recent post revisions instead of saving all the posts. However, you can change the integer number in the code to modify the limitation.

Customizing the Auto Save Interval

You can also customize the autosave interval with a simple line of code. This code allows you to increase the auto-save interval to save fewer revisions. Go to the wp—config.php file. Now add this line of code to the top.

 

define( ‘AUTOSAVE_INTERVAL’, 600 );

 

WordPress save your post revisions every minute (60 seconds) by default. When you add the above line, it will increase to 600 seconds ()10 minutes). You can always change the duration by adding a new integer in the code.

Deleting Post Revision

If you want to delete post revisions for all past post, you need to add one line of code. For deleting the post revision, go to your site’s PHPMyAdmin. Now execute the SQL query:

 

DELETE from wp_posts WHERE post_type = “revision”;

 

It will remove all posts from the database. However, you should keep a backup before deleting the post.

Code Credit: wpbeginner

Deleting Post Revision Using a Plugin

If you are not interested in using codes for deleting post revision, you can use a plugin. There are different plugins for this task. But the easiest one is Revision Control.

Revision control allows the blogger to customize the post revision. You can choose from a variety of options. It requires only a click to enable the option. It allows you to enable, disable the post revision feature without any hassle. You can also set the limit of some post revisions. You can also set restriction for some particular posts.

Just download the plugin from here. Now upload the unzipped files and install the plugin. After installation, go to settings and activate the plugin. You don’t have to spend money for this plugin. It is an open source.

So, what you have learned from this post are-

  1. You can disable/enable post revision with a one-line code.
  2. Limiting the post revision is also possible with the code.
  3. You can delete the post revision for past posts with a simple code.
  4. You can use a plugin to avoid the hassle of coding.

 

Finally, I want to tell you in my opinions. It is the best feature for an avid blogger. You should not disable this post revision feature to save a copy of your posts. If you really need it, then go for it.

I hope this informative article blows your mind to know more about wordpress features. Thanks for reading this article, Feel free to do fifty – fifty this article with your friends and family by Facebook and Twitter.

Web Hosting

Leave a Reply