How to Delete WordPress Post Revisions To Reduce Database Size

It is also made sense to delete and remove all existing stored post revisions and changes made on pages stored in the database in order to reduce the wp_posts table size, especially when there is already tons of revisions or changes been kept. After this operation you can reduce several MB size of your wp_posts table.
To view your post revisions, select any post and click edit button then scroll down to bottom of the page.
Delete WordPress Post Revisions 1

To delete and remove all existing post revisions entries, delete all rows from WordPress database Posts table having post_type value as revision.

Login to MySQL command-line interface
phpMyAdmin (SQLyog or other MySQL GUI tools) ==>  Select the appropriate WordPress database (if you have more than one databases on the same server)  ==>  and then issue the following command (it’s also recommended to backup the database before performing the deletion SQL statements):
DELETE FROM wp_posts WHERE post_type = "revision";

Delete WordPress Post Revisions 2

After this operation goto post page and click edit button then scroll down to the bottom of the page. Then there is no entry for revisions.

Delete WordPress Post Revisions 3

Once all post revisions related records is purged, all revision histories are deleted, and users no longer able to check the changes by phase or compare differences between versions. Thus, deletion may also been used by administrator to ensure privacy or stop authors or writers in the blog from knowing their posts have been edited.

You can leave a response, or trackback from your own site.

Leave a Reply