Remove WordPress Revisions and PostMeta

WP Security

Speeding up WordPress

More like cleaning up WordPress, but anyway. I see this code all the time and I use it,but I can see how some people may get confused by it. So I am going to try and tell you how to modify it for your own WP database.

The code below is pretty simple, but you cannot just copy and paste for it to work. You will need to be using PHPMyAdmin which you normally get from your hosting provider. Once inside here find your database on the left hand side and look for your WordPress tables.

Normally your tables will look something like wp_posts, but if you are a little more secure then you will have changed the prefix wp to something else.

The PREFIX is in red, make sure you change the red code below to your prefix.
DELETE a, b, c
FROM prefix_posts a
LEFT JOIN prefix_term_relationships b
ON a.ID = b.object_id
LEFT JOIN prefix_postmeta c
ON a.ID = c.post_id
WHERE a.post_type = 'revision'
Photo Source: http://www.flickr.com/photos/nbachiyski/ / CC BY 2.0

About Jim Gaudet

An IT guy relaxing in Costa Rica
This entry was posted in Wordpress. Bookmark the permalink.

3 Responses to Remove WordPress Revisions and PostMeta

  1. Mark Downson says:

    If your site is loading slowly, look at how many plugins you’re using. If the answer is more than ten, look at the plugins you’re using and ask yourself whether you can integrate them directly into your theme.

    While you’re at it, also ask yourself whether you really need the plugin. If you can do without it, do.

  2. Pingback: Tweets that mention Remove WordPress Revisions and PostMeta -- Topsy.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>