Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Created September 27, 2013 18:51
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 wpsmith/6733437 to your computer and use it in GitHub Desktop.
Save wpsmith/6733437 to your computer and use it in GitHub Desktop.
SQL: Remove orphaned wp_usermeta
DELETE FROM wp_usermeta WHERE user_id NOT IN (SELECT ID FROM wp_users)
DELETE FROM myprefix_usermeta WHERE user_id NOT IN (SELECT ID FROM myprefix_users)
@wpsmith
Copy link
Author

wpsmith commented Feb 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment