Created
December 22, 2011 00:57
-
-
Save ammist/1508426 to your computer and use it in GitHub Desktop.
WordPress SQL queries I use a lot
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
-- Life is better when you can cut and paste | |
-- Post meta | |
------------- | |
-- Site Options | |
------------- | |
select distinct option_name from wp_options; | |
------------- | |
-- User data | |
------------- | |
-- Get the user meta names. | |
select distinct meta_key from wp_usermeta; | |
-- Get user capabilities. This will tell you if they are, say, | |
-- an admin, a subscriber, or have some custom capability assigned. | |
select distinct meta_key, meta_value from wp_usermeta where meta_key like '%capabilities%'; | |
select distinct meta_key, meta_value from wp_usermeta where meta_key like '%capabilities%' && meta_value like '%espresso%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment