Skip to content

Instantly share code, notes, and snippets.

@KryptikOne
Created April 25, 2019 16:56
Show Gist options
  • Select an option

  • Save KryptikOne/dcc90c167dc800501792a7560556fcf0 to your computer and use it in GitHub Desktop.

Select an option

Save KryptikOne/dcc90c167dc800501792a7560556fcf0 to your computer and use it in GitHub Desktop.
Query to get all the users in a WordPress Instance and what role they have.
SELECT user_login,user_email,display_name, SUBSTRING_INDEX(SUBSTRING_INDEX(m.meta_value, ':"', -1), '"', 1) FROM wp_users as u
JOIN wp_usermeta as m
ON u.ID = m.user_id
WHERE m.meta_key = 'wp_capabilities'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment