WordPress-Disable Post Revision

I noticed that the Post Revision is enabled in my UAT wordpress site which running on ubuntu 16.04 LEMP Server, and please refer to the steps below to disable it

Edit the wp-config.php file

sudo vi /var/www/html/wordpress/wp-config.php

Add the following two lines to disable the Post Revision

define('AUTOSAVE_INTERVAL', 300 ); // Change Autosave to 5 Minutes
define('WP_POST_REVISIONS', false ); //DISABLE future Post Revision only

Add the code above the following Section

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
        define('ABSPATH', dirname(__FILE__) . '/');

Login to MariaDB to delete the existing revision

sudo mysql -u root -p
Enter password:
MariaDB [(none)]> use wordpress
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [wordpress]> DELETE FROM wp_posts WHERE post_type = "revision";

Reference link
How to Disable Post Revisions in WordPress and Reduce Database Size

Leave a Comment

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

Scroll to Top