Post Revisions in WordPress is the feature that save copies of each changes made to a post or page. It allows the user to revert to the old copy of post or page. Well in this article we will share how to disable, set the maximum number per post or page, or even delete the Post Revision.
Disable Post Revisions
If you do not want post revision in your WordPress site, you can disable it by adding the the following to your wp-config.php file.
define( ‘WP_POST_REVISIONS’, false );
Set The Maximum Number of Post Revision
By default, WordPress will set the maximum number of post revisions to maybe unlimited. So if you want to set the maximum number of your own choice, you can get it done by adding the following one line of code to your wp-config.php file.
define( ‘WP_POST_REVISIONS’, 5 );
Change the 5 to any number of your choice
Note: Setting the maximum number of post revisions will not work if you disable post revisions.
Delete Post Revisions
There are many WordPress plugin out there that will help you to delete these post revision. But at this time we will show you by using phpmyadmin
Before continue this step, we recommended that you backup the database of your site.
First of all open the phpmyadmin and select the database of your site.
Next go to SQL tab and paste the below SQL query.
DELETE FROM wp_posts WHERE post_type=’revision’;
Replace wp_ with your databases prefix and execute the query
After you execute the above query, all the post revisions in your site will get deleted
Hope that you this article helps you to manage the Post Revisions in your WordPress site. If you have any questions or suggestions, please feed free to let us know by leaving a comment below.