Home ยป How to Disable Post Revisions in WordPress?
Wordpress

How to Disable Post Revisions in WordPress?

Disable Post Revisions in WordPress to optimize your database and it will helps you to increase website loading time and speed.

WordPress saves posts whenever they are updated and creates revision files for backup purposes.

Say we have one post and which is updated around 10 times in 7 days. Now WordPress creates 10 revision files during each post update. If this repeats for every post on your website then the WordPress makes sure there will be saved revision files and this leads to an increase in database size. So you need more server resources (CPU and RAM) to handle your database and finally increase in hosting payments.

We have different options to control the above-discussed problem by optimizing your database and which helps you to increase your website loading time and speed.

Disable Post Revisions in WordPress

To do this, open the wp-config.php file available in your WordPress root directory.

Follow the below steps to reach the wp-config.php file.

  1. Install a File Manager plugin.
  2. Activate the above plugin
  3. Open the File Manager Plugin and select the wp-config.php file as shown below.

File Manager Plugin in WordPress

4. Right-click on wp-config.php file and select “Editor”

5. Add the below code in the file, save and close it.

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

define(‘WP_POST_REVISIONS’, false );

The above code disables the future revision files for the posts. The default WordPress autosave interval is 60 seconds which means WordPress autosaves your post every minute. The above code updated your autosave interval to 5 minutes thus optimizes your database and server resources.

We solved the post revisions for future posts which are to be published and updated the timing of autosave. Now if you are interested to delete the past saved revision files then follow the below steps.

  1. Open the PHPMyAdmin from your control panel
  2. Run the below SQL query

DELETE FROM wp_posts WHERE post_type = “revision”;

The above code deletes all the saved revision files from your WordPress database.

Related posts

How to Bulk Add Categories to WordPress Posts without using a Plugin?

Padmini

How to Stop Spam Comments on WordPress Blog?

Padmini

Leave a Comment