Last active
July 2, 2024 00:48
-
-
Save loorlab/b43703bee856a165a18eea9a6782db3d to your computer and use it in GitHub Desktop.
Master Query - MySQL - WordPress
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
# ------------------------------------------------------------ | |
# Master queries to modify databases in WordPress ------------ | |
# ------------------------------------------------------------ | |
# show all admin users | |
SELECT u.ID, u.user_login, u.user_email, u.user_nicename, | |
um.meta_value AS capability | |
FROM wp_users AS u | |
INNER JOIN wp_usermeta AS um ON (u.ID = um.user_id) | |
WHERE um.meta_key = 'wp_capabilities' | |
AND um.meta_value LIKE '%administrator%'; | |
# show all non-admin users | | |
SELECT * from wp_users us | |
WHERE us.ID NOT IN (7, 7000, 514, 379, 397, 649, 0069, 699, 949, 4113) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment