How to Disable and Re-Enable Post Revisions in WordPress and Reduce Database Size

Hello WordPress learners, in this tutorial I will explain some extraordinary ways how to disable and re-enable post revisions in WordPress and reduce database size. Post revisions are one of the great features of WordPress, but some users do not want to allow this featured on their website because of database limitation. For the users who have limited database or for the users who do not wish to autosave in their website, they can disable or enable post revision on WordPress website by adding the following codes.

How to Disable Post Revisions in WordPress and Reduce Database Size

How to Disable Post Revisions in WordPress:

Open your wp-config.php. If you do not find this visit your WordPress root directory and add the following code. We recommend you to add the next line of code at the very top of wp-config.php.

define( ‘WP_POST_REVISIONS’, false );

How to Re-enabling Post Revisions in WordPress:

Our previous code line for disabling the post revision but if you want to re-enable this post revision in the future for any reason you need to replace the code with the following code in your wp-config.php file:

define( ‘WP_POST_REVISIONS’, true );

Limiting Post Revisions in WordPress:

If you do not want to autosave every time, you need to limit your autosave in per post. For this, the best way is to set a limit on the number of post revisions. This is when you need to add the following code in wp-config.php.

define( ‘WP_POST_REVISIONS’, 3 );

What the line does is it will save just 3 recent posts instead of saving all of the post revisions.
Suppose in a single post you need just 2 or 3 revisions and others older posts will be automatically deleted so that you can save your database. Here you can replace or change with integer according to your need.

How to Setting Up your Auto-Save Interval in WordPress:

If you want fewer autosave in your database to instate of limiting post revisions, you can also set auto-save interval. Open up your wp-config.php file- located root folder of WordPress and add the following code line:

define( ‘AUTOSAVE_INTERVAL’, 600 );

WordPress set this option in its root function 60 seconds or every minute. When you add this code, a post revision will be saved every ten minutes (600 seconds). It helps users to reduce their database size.

If you far away to add code in your wp-config.php file you can also complete this job installing some popular plugins are WP-Sweep and WP Revisions Control. You can try them to do this.

How to Remove Old Post Revisions in WordPress:

Well, in this section, I will try to explain how you can permanently delete old post revision from your WordPress database.

For this, we will show you two compatible methods for you. One way will use the code, and another one will use the plugin. People who are used to with SQL queries then you can go with the first method. If you’d like using a plugin, then go ahead the second method. If you are a non-techie, go with the plugin. (recommended)

Method 1: Deleting Post Revisions Using Code:

You can delete your old post revision from your database by using code. You can also do this using a plugin ( we’ll cover this in next method).

When you would like to delete all of your past post revisions from your website’s database, go to your website’s PHPMyAdmin and execute the following SQL query:

DELETE from wp_posts WHERE post_type = “revision”;

This SQL query will delete all old post revision from your database. We suggest you take your database backup before adding the code.

Method 2: How to Delete Post Revisions Using A Plugin:

Revision Control is the most popular plugin for deleting post revision. Just install and active Revision Control from your plugin area developed by By Dion Hulse. If yet do not know how to install plugin have a look how to install WordPress plugin.

Download Revision Control from Here

The plugin allows the user to set a site-global setting (Settings -> Revisions) for pages/posts to enable/disable/limit the number of revisions which are saved for the page/post. The user may change this setting on a per-page/post basis from the Revisions Meta box.

How to Disable Post Revisions in WordPress and Reduce Database Size (1)

 

Revision Control is a popular plugin for WordPress which offers the user more control over the Revision functionality. Let’s see some amazing ways how to disable and re-enable post revisions in WordPress and reduce database size.

Another Deleting Post Revisions Using Plugin:

It could be explained that revision will gradually raise the size of your database. well, If you save a post or page multiple times, your number of revisions will significantly increase over time. For instance, if you have 10 posts and each post has 10 revisions you could be storing up to 1,00 copies of older data!

Download Better Delete Revision from Here

 

How to Disable Post Revisions in WordPress and Reduce Database Size (2)

 

Again install and activate this plugin and make sure developed by Galerio & Urda. From your admin area go to Settings >Better Delete Revision

 

How to Disable Post Revisions in WordPress and Reduce Database Size (3)

 

From this page, you can see check all of your post revisions and also you can do optimize your database. Look at the top of this page then you will see this two options.

If you are interested in checking revisions post, click “Revisions Post” option from the top of this page or Optimize your database click on that.

Once you clicked one of them. Suppose, you clicked check post revision and scrolled down all of the ways of this page.

How to Disable Post Revisions in WordPress and Reduce Database Size (4)

 

Lastly, at the bottom of the page, you will see the way of deleting your post revision.

Conclusion:

Post Revision does not slow your website it just fills up your database with unnecessary data. In this article, I tried my best to explain how to disable and re-enable post revisions in WordPress and reduce database size.

Hopefully, you will find this essay and knew how to disable and re-enable post revisions in WordPress and reduce database size. If it is useful then subscribed to our YouTube channel to get more helpful tips and tricks on WordPress. If you do this job in other ways, let us know by commenting. Thank you.

LLN Team

About The Author : LLN Team

We are LLN Team promise you to provide you useful information about website and blog creation. We will focus on WordPress and other essential needs. Keep browsing Lets Learn Now. Cheers

Leave a Reply

Your email address will not be published.

Please post a relevant comment and make the conversion informative.