How to Disable Post Revisions in WordPress

By Default WordPress creates Post Revisions each time you click Save Draft or Update any given post.These Post revisions will help you in tracking the changes you’ve made & will allow you to revert to an earlier version if necessary.

As WordPress continues to create Post Revisions even for a small change made to post this increases the Size of the MySQL database & WordPress by default doesn’t carry out any cleaning task to remove older post revisions.

Why to disable WordPress Post Revisions

I personally like Post Revision feature but If you are using some Free Hosting Provider to Host your WordPress site or If are some one who have limited database space then it’s recommended for you to Disable WordPress Post Revisions functionality.

What are WordPress post Revisions

How to Compare WordPress post Revisions

To see the differences between two WordPress Post Revisions, select a revision date in the Revisions section under the text editor. Now Select another date in the revisions list, click Compare Revisions, and you can check out the two versions of your post side by side, where the changes would be highlighted. In the below example, we’re comparing two versions of the same post.

How to Compare WordPress post Revisions

How to restore to older version of WordPress post revision

To restore a previous version of a post, click Restore for that date and the post is restored back.

How to Disable WordPress post revisions

Disable Post Revisions in WordPress :

Open wp-config.php located in your WordPress root directory and add the following code:

// WordPress post revisions Time Interval

define(‘AUTOSAVE_INTERVAL’, 900 );

//Disabling WordPress Post Revisions
define(‘WP_POST_REVISIONS’, false );

The code above will help you disable all future revisions & it will change the autosave interval from default 60 seconds to 900 seconds.

How to Limit post Revisions in WordPress :

Disabling post revisions is only good if you have limited database space, but If you want to retain this feature I would suggest you to limit the number of Post Revision’s WordPress saves.

Add the below line code to wp-config.php file and save it.

// Limit post revisions in WordPress
define(‘WP_POST_REVISIONS’, 2);

The above line of code will tell WordPress to save only 2 Latest Post revisions.

Note: This code’s above will not remove already created post revisions from the database, you need to do it manually accessing the MySQL database or by using any WordPress database Optimization Plugin like WP-Optimize.

Hope you got a clear Idea on How to Disable Post Revisions in WordPress.If you need any help please contact us through the comments Section.