Skip to content

Instantly share code, notes, and snippets.

@petenelson
Created May 3, 2016 18:00
Show Gist options
  • Save petenelson/1357af581a0664e052e63275d7a2177f to your computer and use it in GitHub Desktop.
Save petenelson/1357af581a0664e052e63275d7a2177f to your computer and use it in GitHub Desktop.
WordPress: MySQL query to list user names, emails, and first & last name
SELECT wp_users.user_login, wp_users.user_email, firstmeta.meta_value as first_name, lastmeta.meta_value as last_name FROM wp_users left join wp_usermeta as firstmeta on wp_users.ID = firstmeta.user_id and firstmeta.meta_key = 'first_name' left join wp_usermeta as lastmeta on wp_users.ID = lastmeta.user_id and lastmeta.meta_key = 'last_name'
@utsukushiihime
Copy link

Thank you!

@VegasWebsiteDesigns
Copy link

Thank you, very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment