WordPress delete autosaved article posts revisions

By default wordpress saves all post revisions from time to time and it might clutter up your database and increase it’s size.

If you want to delete the autosaved post revisions on your wordpress blog manually from phpmyadmin using sql query instead of trying out plugins, follow these steps ( assuming that you have access to your website’s control panel / phpmyadmin or mysql manager ):

Step 1: Log into your server and goto phpMyAdmin

Step 2: Select your database from the list of databases on the left side

Step 3: Click onĀ SQL tab to open the sql query box page.

Step 4: Type this query in the sql box and press Go button (press confirm again on next page once you submit this query)

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';

This will delete all wordpress posts revisions from all the posts including all their meta data.

Leave a Reply

Your email address will not be published.