Restrict Number Of Post Revision In WordPress

Restrict Number Of Post Revision In WordPress

Post Revision In WordPress

Whenever you make any changes in a post and update it, WordPress saves it a draft copy. Since by default WordPress does not limit the number of revisions / draft that are saved, post revisions can be a waste.

Because every time you click on the update tab in the wordpress editor, it gets saved as a draft copy. This takes up the same amount of storage space in your database. For example if you update a post ten times, wordpress stores it as ten published post on your server.

That’s a lot of storage space being wasted.

Thankfully, WordPress allows you to limit the number of post revision in wordpress / drafts that are saved

I personally feel that two or three post revisions is more than sufficient. I don’t see any reason why you should have more post revisions saved.

Many website owners reduce this to just one.

I have quite a few popular articles, like How to increase BSNL 3G data card speed and How to setup Wimax outdoor Unit for maximum signal.

I frequently update these articles, with the latest infos. As you can see from the below image, wordpress has saved 9 (nine) revisions of one of my posts. This is way too many, as each revision is taking storage space of 9 full posts.

     Post Revision In WordPressWordPress does allow you to limit the number of post revisions that are saved on your server.

All you need to do, is to add a line of code to your wp-config.php file.

                     define( ‘WP_POST_REVISIONS’ , 3 );

Note: The above code will restrict post revision in WordPress to 3. Any additional post revisions will automatically replace the older version. See the image below where to add this code in wp-config.php.

Post Revision In WordPress

If you wish, you can also completely disable post revision, by changing the value in the above code to “0” or “False”

Many website owner are not comfortable with editing codes. If you are one of them, I would recommend using a plugin such as Simple Revision Control, to restrict post revision in wordpress.