Created
May 3, 2012 17:07
-
-
Save dongilbert/2587304 to your computer and use it in GitHub Desktop.
This SQL will delete postmeta that's still around from deleted posts.
This file contains hidden or 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
-- Old Post Meta sometimes creeps | |
-- in from manually deleting revisions | |
-- and other things direct from the | |
-- database. Using this SQL below | |
-- you can remove the postmeta remnants | |
-- that have been left behind. | |
DELETE a | |
FROM wp_postmeta AS a | |
LEFT JOIN wp_posts AS b | |
ON b.ID = a.post_id | |
WHERE b.ID IS NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment