In this post, I will show you how you can delete WordPress post revisions from the database.
What are Post Revisions & When WP creates them?
Post revisions are basically different versions of your post which are created by WP whenever you hit “Save Draft” or “Update” button. For example, while writing a post if you hit “Save Draft” 10 times then WordPress creates 10 post revisions for the post you are currently writing. Similarly, when you press “Update”, WP create a post revision each time. At maximum, WordPress create 25 post revisions for each post or page on your blog.
If you want to see a number of post revisions for a post or a page you are working on, you can see that my clicking on “Save Draft” or “Update” or “Publish” button at the right-hand side of your post editor.
How to Delete WordPress Post Revisions & Optimize WordPress Database ?
Now, you know how to see WordPress post revisions for your post and pages in your blog. At some point in time if you feel that you want to remove post revisions from the WordPress database then there should be a way to do that right ? Deleting posting revision is something you should take very seriously. Because this ensures better site performance by deleting items from the database which you don’t need. After deleting post revisions, you will itself feel better site load time than before.
Do you know? – How to disable post revision in your WordPress Blog?
At First, we are going to install & activate the free WordPress plugin WP-Optimize, developed by Ruhani Rabin. This is most widely used and rated plugin which has over 500,000+ active installs with a 4.8 out of 5-star rating.
Next thing before you use this plugin is to take the full site backup. These plugins generally work as expected but as a site owner, it’s it is important for you to backup everything before deleting anything from the database. I have personally used WP-optimize on my blog and I had never faced any problems with it. For backing up my blog I use “BackWPup – WordPress Backup Plugin”. It’s a FREE wordpress backup plugin with great features like automatic backups jobs, database optimization, check and repair database etc.
Pre-run Wp-Optimize settings
Once you have installed Wp-Optimize, click into WP-Optimize on your sidebar within your WordPress dashboard. The main setting page of WP-optimize will look something like this –
In the above setting page, there are two main ones which I recommend to anyone who wants to delete wordpress post revisions from the WP database.
- Clean up Post revisions , &
- Optimize Database Tables
You can check other options also to delete spam comments, unapproved comments, all auto draft posts, and post in the trash. Once you are ready, just click on the “PROCESS” button.
Before hitting process, I just unchecked other options other than what I stated above. After successful processing, you can see WP-optimize has deleted 67 wordpress post revisions and optimized the ‘harpreet_wrdp1’ database successfully.
That’s it. It’s done! You can see in the image below that there are no more wordpress post revisions or page revisions in the database and the process saved almost 1MB of space.
I have seen dramatic speed increases by doing this. You can also limit the number of revisions in WordPress. Check out this post if you want WordPress to limit the number post or page revisions or you want to disable post or pages revisions altogether. Read Here.
If you have any question, feel free to comment below. Also, share this useful tip with others too.
Don’t forget to LIKE Digital Harpreet Facebook Fan Page
You can also follow me on Twitter for latest updates related to WordPress, Blogging, Social Media & Marketing.