Reduce the number of post revisions being stored on WordPress

WordPress post revision is one excellent feature of WordPress that allow you to take progressive backups of your post each time you save or publish it. Besides the manual saving each time you update, the autosave feature will also take a backup of your post. This means that even if you forgot to save or something happened and you could not save, your content will be saved automatically.

These are called WordPress post versions or revisions rather than backups. Each version stores the changes between posts.

 

wordpress post revisions

Since WordPress 3.6, the post revision feature has been enhanced and now allows you to compare two different revisions that you’ve saved previously. It also highlights the difference between two revisions and even allows you to easily switch between the revisions using the slider bar at the top.

The problem with post revisions

Many times, the post revision can be a lifesaver for your articles as it allows you to compare between many different versions of your post. However, the biggest disadvantage of using this feature is that since it saves unlimited versions of your article, you get ton of extra posts saved in your database.

In reality, you might not actually need that much amount of revisions being saved on your server. In addition, if you are on shared hosting with limited database size, chances are you easily get run out of the database space as it saves multiple versions of your posts.

In this post, we’ll guide you how to reduce the number of post revisions got each post that being stored on your database.

Reducing the number of post revisions

According to Mike Little, the co-founder of WordPress, “WordPress’ database queries do *not* retrieve revisions, so the number of revisions has no effect on the queries. The only time the revisions are retrieved is on the edit page of the individual post. There is no impact on the front end speed of your site.”

Though the front end of speed of your site will not get affected with the number of revisions, people still love to reduce the number of revisions being stored on the database as most of them are using WordPress under limited database storage.

Simply copy the below code snippet to your wp-config.php to limit only 3 revisions to be saved on each post:

define( 'WP_POST_REVISIONS', 3 );

Although, the post revision is one of the greatest features, some people prefer not to have this feature at all. If you are among those who don’t want any revisions to be saved on your database, you may add the following code snippet to your wp-config.php file.

define( 'WP_POST_REVISIONS', false);

Do you find the post revision as a life saving feature? Share your story with us by commenting below.

Download the list of 101 WordPress tricks every blogger should know

101 WordPress tricks

Click here to Download Now

One more thing...

Do you have friends or a Facebook group who you think would find this useful? Share this with them and then let me know what they think.

Want to supercharge your website?

 
Our website loads FAST ... just 1.29 seconds. We're hosted on FAST InMotion VPS servers We want YOUR website to be fast too, so we've gotten you an exclusive deal - 47% OFF for DART Creations friends + FREE domain! Check it out NOW!