Created
November 5, 2011 23:20
-
-
Save milohuang/1342178 to your computer and use it in GitHub Desktop.
WordPress Delete Revisions 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
-- If for some reason you associated a revision with | |
-- a tag or a category that was then removed when the | |
-- final post was published, you will have extra entries | |
-- in other tables such as terms. | |
-- http://weblogtoolscollection.com/archives/2010/09/28/deleting-wordpress-revisions/ |
Great man, that's really helpful :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Even that will leave traces, best is to use WordPress functions to delete post. See http://blog.ashfame.com/2010/04/handling-wordpress-post-revisions-correctly/