How to Disable WordPress Revisions and Delete Old Revisions

This quick tutorial is going to show you how to disable WordPress revisions and delete old revisions. Revisions can take unnecessary space in your WordPress database and in the long run your WordPress database will become slow because there are lots of revisions.

Completely Disable WordPress Revisions

Edit the wp-config.php file under the WordPress root directory and add the following lines above the require_once(ABSPATH . 'wp-settings.php'); line.

/** disable post revision. needs to be above require_once **/
define('WP_POST_REVISIONS', false);

disable wordpress revisions

Save the file and you are done.

Delete Old Revisions

Your old revisions still exists and they are taking up space in your WordPress database. To delete all old revisions, run the following MySQL query.

DELETE FROM `wp_posts` WHERE `post_type` = "revision";

On one of my WordPress databases, the above command reduced the database size from 108MB to 30MB.

Wrapping Up

I hope this tutorial helped you disable WordPress revisions and delete old revisions.

Rate this tutorial
[Total: 1 Average: 5]

Leave a Reply

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