Skip to content

Instantly share code, notes, and snippets.

@loorlab
Last active July 2, 2024 00:48
Show Gist options
  • Save loorlab/b43703bee856a165a18eea9a6782db3d to your computer and use it in GitHub Desktop.
Save loorlab/b43703bee856a165a18eea9a6782db3d to your computer and use it in GitHub Desktop.
Master Query - MySQL - WordPress
# ------------------------------------------------------------
# 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