Last active
June 14, 2017 07:09
-
-
Save ajaydsouza/eaa56cb5220333e3e753f9885f7adc91 to your computer and use it in GitHub Desktop.
Delete old wp post meta entries
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
DELETE FROM `wp_postmeta` | |
where meta_key LIKE '_su_%' | |
OR meta_key LIKE '_aioseop_%' | |
OR meta_key LIKE '_sexybookmarks_%' | |
OR meta_key LIKE '%SexyBookmarks%' | |
OR meta_key LIKE '%OgTags%' | |
OR meta_key LIKE 'digg' | |
OR meta_key LIKE 'ratings_%' | |
OR meta_key LIKE '_utw_%' | |
OR meta_key LIKE 'dsq_%' | |
OR meta_key LIKE '_utw_%' | |
OR meta_key LIKE 'fsb_%'; | |
DELETE pm | |
FROM wp_postmeta pm | |
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id | |
WHERE wp.ID IS NULL; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment