Disable WordPress Post Revision

post-revisions

When you edit your post or page in your WordPress page or post editor, then, WordPress will automatically save the post as well as the edited page in draft, and creates its revision in the used WordPress database table. Hence, this can take lots of space in your database and making the size of the database too large. So, if you have limited amount of database space provided from your hosting provider, then deleting the WordPress post revision from the database table would help you any time, because it can take a lot of space in your database and in return can also make your site speed slower than usual, since there might be need of lots of database query. So, some of the precaution method which can be taken to disable WordPress post revision are:

Setup the post revision delay in WordPress

WordPress by default, saves the data automatically per minute, which can lead a lot of post revisions upon small post edits. Hence, increasing the time interval of the auto-save feature of WordPress post and pages is most preferred. So, you might want to actually apply it in your own site after knowing about its importance, right? So, for the solution on it, you have to edit your wp-config.php file, in order to increase the time limit in WordPress for auto-saving the WordPress posts. The code which needs to be added in this file is given below:

define('AUTOSAVE_INTERVAL', 600);
define('WP_POST_REVISIONS', false);

The above code provided will prevent WordPress from saving the future post revisions and delays the time to auto-save the post by 600sec, ie. 10min. Also, you can increase this time as you want for your blog or website for auto-saving the post time. Remember that the above provided code does not remove the post revision which already exists in your WordPress database table. So, there is another way to delete the post revision in WordPress that already existed there.

Delete the existing post revision in WordPress using phpmyadmin

For deleting the existing post revision from your WordPress database, you can visit the phpmyadmin from your host’s cpanel address and open the respective database table which is used for creating your blog or website, and then you can visit the SQL tab of that database table. The code for deleting the existing post revision in your WordPress powered site is given below:

DELETE FROM wp_posts WHERE post_type = "revision";

Now, after doing the above mentioned steps, you do not have any post revision in your database table and your database size has been reduced quite a lot, which can be utilized by any other database too, and also will have more database space for your WordPress site too, currently installed, if you prefer to use it, from which more posts as well as the pages can be added to your site from the freed posts revisions.

Remember: If you have unlimited database space provided by your hosting provider, then, the post revision will be of great use. So, do not use this if you have access to unlimited database space, which can be of great use in your future, such as if you have written some post already and then edited it and then in the edited post, some error has come up, while there was no error in the previous revisions, then, you an go back to that revision of post easily, if you have not deleted your post revision and your post will come up good again as needed. Hence, it is up to you, if you really need to do this, you can follow the above mentioned steps, else, you can leave it as it is currently in your site to be more safe and secure for the future purposes.

Post navigation

Bishal Napit

Bishal Napit is a WordPress theme developer from Tansen, Palpa, with a passion to learn more on WordPress.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.