If you are like me, sometimes you update WordPress posts quite a lot, which can lead to a long list of Post Revisions for your posts. While this is very helpful if you need to go back to a recent version of the post, sometimes it can get cluttered.
Just head over to phpMyAdmin from your Site Hosting Account, and run the following query on your WordPress database. This will delete all post revisions and the meta associated with them from your WordPress database. I strongly suggest making a backup of your WordPress database before running this query, which is always a good idea for any changes to your database.
DELETE a,b,c FROM wp_posts a WHERE a.post_type = 'revision' LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id);
Now that these Post Revisions are gone, your WordPress posts should be a little less cluttered.
Also, click here if you would like to learn how to disable or limit the WordPress Post Revisions Feature.
techalam says
Just what I needed. Thanks for the code and tweeted 🙂