How to Disable Post Revisions in WordPress

How to Disable Post Revisions in WordPress

WordPress provides a very good feature of Post Revisions. Every time you save the post it creates a Post Revisions in database so user can get back the old post. But Some WordPress users does not like the Post Revisions.

Disabling Post Revisions also save database space. Disabling this feature keeps database clean and short and it saves the website to be slow caused by too many records in the database.

To disable Post Revisions open wp-config.php file, you can find this file in your WordPress root directory and add the following code:

define(‘WP_POST_REVISIONS’, false );

Now Post Revisions has been disabled and post revisions will not be save in the future but If there are previously creates post revisions exists in your database then you have to delete them by execute a Mysql query.
Please open the Phpmyadmin or whatever database tool you use to manage database and execute this query.

DELETE FROM wp_posts WHERE post_type = “revision”;

it will delete all the posts revisions from your WordPress database.

There are one more feature in WordPress AUTOSAVE_INTERVAL. Wordperss saves post every minute by autosave. We can also set this time interval. add the below code in you wp-config.php file.

define(‘AUTOSAVE_INTERVAL’, 300 ); // seconds

This will autosave your WordPress post in every 5 minutes instead of saving in every 1 minute.

Leave a Reply

Your email address will not be published. Required fields are marked *

14 + 10 =