How to: Batch deleting post revisions

Post revisions, a WordPress 2.6 new feature can be very usefull, but it also increase the size of your MySQL database. Sure, you can manually delete posts revisions, but that’s a very long and boring work. Another solution is what I’m going to teach you: Batch deleting post revisions.

First of it all, login to your phpmyadmin and select your WordPress database. Once done, click on the sql button to open the sql command window.

Paste the following sql command in the sql window:

DELETE FROM wp_posts WHERE post_type = "revision";

Work's done. You saved a precious space on your database by deleting unnecessary post revisions.

2 Responses

Jan 19 2012 12:49

What about attached media?

May 23 2012 17:23

Is there any way to delete post revisions one my one or one post revision at a time? I mean I want to keep the revisions on some post but want to dump others.

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox