How to get userinfo out of wordpress?

Wordpress get all userinfo

  • Is there a way to get all user's userinfo including user_meta via wordpress function or sql query?

  • Answer:

    Yes, there is, and there are alot of different functions for different purposes alone for those matters. Have a look at the http://codex.wordpress.org/Function_Reference, section User and Author Functions, its all documented very good.

Bjoern at WordPress Visit the source

Was this solution helpful to you?

Other answers

I think that what you're looking for is http://codex.wordpress.org/Class_Reference/WP_User_Query. WordPress 3.1+ Example: <?php $wp_user_query = new WP_User_Query(array('fields' => 'all_with_meta')); $users = $wp_user_query->get_results(); if ( ! empty($users) ) foreach ( $users as $user ) echo $user->ID . ' ' . $user->user_login . PHP_EOL; In earlier version of WordPress (2.1 - 3.1), you'll need to use the WP_User_Search class instead. This function has been deprecated in WordPress 3.1. WordPress 2.1 - 3.1 Example: <?php $wp_user_search = new WP_User_Search(); $users = $wp_user_search->get_results();

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.