Created
September 27, 2013 18:51
-
-
Save wpsmith/6733437 to your computer and use it in GitHub Desktop.
SQL: Remove orphaned wp_usermeta
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 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For more information, see the tutorial here: http://wpsmith.net/2014/snippets/popular-wordpress-sql-user-administration-scripts/