Skip to content

Instantly share code, notes, and snippets.

@ajaydsouza
Last active June 14, 2017 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajaydsouza/eaa56cb5220333e3e753f9885f7adc91 to your computer and use it in GitHub Desktop.
Save ajaydsouza/eaa56cb5220333e3e753f9885f7adc91 to your computer and use it in GitHub Desktop.
Delete old wp post meta entries
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