Created
February 15, 2014 18:00
-
-
Save wpsmith/9022838 to your computer and use it in GitHub Desktop.
SQL: Get all administrators
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
SELECT u.ID, u.user_login, u.user_nicename, u.user_email FROM wp_users u INNER JOIN wp_usermeta m ON m.user_id = u.ID WHERE m.meta_key = 'wp_capabilities' AND m.meta_value LIKE '%admin%' ORDER BY u.user_registered | |
SELECT u.ID, u.user_login, u.user_nicename, u.user_email FROM myprefix_users u INNER JOIN myprefix_usermeta m ON m.user_id = u.ID WHERE m.meta_key = 'myprefix_capabilities' AND m.meta_value LIKE '%admin%' ORDER BY u.user_registered |
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/