You are here:

How to Disable Post Revisions in WordPress and Reduce Database Size

 

Post revisions is one of the function that WordPress has to provide but for some people using this platform  it might not be the best choice. For people who have minimal/limited database space, or for people developing WordPress as a CMS where they do not need autosave, they can basically turn off Post Revisions feature in WordPress by following this guide. By reducing the database size, you can also speed up your website.

 

 

post revisions

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

1 define('AUTOSAVE_INTERVAL', 300 ); // seconds
2 define('WP_POST_REVISIONS', false );

This code will turn off all upcoming modifications to be stored and it will also raise your autosave period from 60 seconds to 300 seconds, so it signifies that your post will be autosaving every 5 minute instead of every minute.

The above code, won’t delete your previous revisions that are already stored in your database. To remove/delete all previous revisions, you will need to visit PHPMyAdmin and run the following SQL query.

1 DELETE FROM wp_posts WHERE post_type = "revision";

This should delete all previously stored post revisions stored in your Database.

Disclaimer: We are not recommending that Post Revisions is a bad option. This guide is only for those who are in the scenario where they need to minimize their database size because of having a limited space on their webhosting.

Posted by Ronelex 0 Responses
     

Leave a Reply to this Post

Dec
9
 
 
Statistics
Personal - Top Blogs Philippines Active Search Results
 
Technology