WordPress

Disable and Remove Old Post Revisions in WordPress

Follow the below methods to turn off WordPress post revisions and remove old saved post versions.

Disable WordPress Post Revisions

Connect to your site via ftp and open your wp-config.php file.

Add the following code just below the define(‘WP_DEBUG’, false); code and save.

define('WP_POST_REVISIONS', false);

With this code, you will have disabled the post revisions. To reactivate it, you can change the false part to true.

Removing Old Post Revisions

When you apply the above process, you will have closed WordPress post revisions, but the post revisions that WordPress automatically saves for all your previous posts are saved in the database.

You can reduce the size of the database and make it work faster by deleting old post revisions.

There are 2 different methods for this.

After connecting to your database from PhpMyAdmin, go to the SQL tab and run the following command.

Before performing any operation on the database, be sure to BACK UP YOUR DATABASE.

DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision'

When you run the command, old post revisions will be automatically deleted.

If you do not want to deal with SQL or do not have sufficient knowledge, you can delete old post revisions using the plugin below.

Leave a Comment

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

Scroll to Top