Title: WP_User_Query and Multisite
Last modified: August 20, 2016

---

# WP_User_Query and Multisite

 *  [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/)
 * I am trying to get all users. All users were created in Network Admin. Some have
   been granted super admin privileges. The others are, according to the quote below,
   automatically subscribers. There are no role options offered in Network Admin.
 * Using WP_User_Query I can only seem to get the super admins.
 * And this yields no one:
    `new WP_User_Query( array( 'role' => 'subscriber' ) )`
 * What gives? How do I get all users created in Network Admin?
 * > User Access: By design, all users who are added to your network will have subscriber
   > access to all sites on your network. To allocate a different default role for
   > users on individual sites, you must use a plugin, such as Multisite User Management.
   > 
   > [http://codex.wordpress.org/Create_A_Network](http://codex.wordpress.org/Create_A_Network)

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/topic/wp_user_query-and-multisite/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wp_user_query-and-multisite/page/2/?output_format=md)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574521)
 * They’re psudeo subscribers. For most sites, they have the same access as a logged-
   out user, and they don’t show up on the user lists.
 * Where are you trying to get all users?
 * The network admin -> Users lists has ’em all.
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574598)
 * I want to display all users on the front end, as a company’s employee directory.
   How can I do that using the users created in network admin? How to call all users
   even if they are pseudo users with pseudo roles?
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574600)
 * Not easily. They don’t exist as a part of any blog, so they aren’t listed in 
   an easily accessible way.
 * Can you add them all to the main site as subscribers for REAL and use that?
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574605)
 * I COULD, but that would be a semantically sad use of the multisite framework.
   The users (employees) are all part of the multisite (company), with different
   permissions per individual site (department).
 * These users and their attributes exist in the database. As such, shouldn’t I 
   be able to query for them?
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574606)
 * Yes, but it’s a DB query since the WP functinos are per-site.
 * Wouldn’t everyone be a member of the main (company) site though? I mean I’m assuming
   you have this:
 * domain.com – Main site. my cool company
 * domain.com/hr – HR’s site
 * domain.com/mail – the mailroom guys
 * etc etc.
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574608)
 * Hmph… I suppose so… but it still doesn’t seem quite right…
 * WP_User_Query( array( ‘blog_id’ => 1 ) )
 * I guess I don’t see why creating (pseudo) users in network admin is even offered
   as an option then…
 * Huh, wait… I, super admin, can create them in network admin, whereupon they will
   get an email to login to their profile, which they can fill in. Then I can check
   it and correct it before assigning them as a subscriber to the main site, whereupon
   they will be listed in the directory…
 * I wonder if there’s a way that I, super admin, can get an email when a (pseudo)
   user or (real) user changes their profile?
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574612)
 * You can use a plugin to auto-add all new users to the main site.
 * [http://wordpress.org/extend/plugins/multisite-user-management/](http://wordpress.org/extend/plugins/multisite-user-management/)
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574628)
 * Hmmmmm. Since we are now blog-specific… why not use the “author” functionality:
   wp_list_authors() and author.php for the author (employee) detail page?
 * It seems “author” = “user” if including the argument hide_empty=0 (show users
   even if they haven’t posted anything)
 * Wouldn’t this be more efficient?
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574629)
 * I have a sneeking memory that author == user with at least a post. I could be
   wrong. It’s been a while.
 * There’s a pay-for plugin called Members Directory which touts that it can do 
   it, but it’s behind a paywall.
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574630)
 * Unless my back is up against the wall, I try to forgo plugins, free or paid. (
   Apparently, I like reinventing the wheel.)
 * But author does = user if you set hide_empty (has no posts) to false. At least
   it did in my limited test.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574631)
 * Aaaaaah! That would do it. 😀
 * I’m pro plugin but anti-paywall. I fork a lot of plugins for what I need. 🙂
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574633)
 * Wish I knew how to fork!
 * Meanwhile it’s time to throw roleless users vs postless authors into the ring
   to see who comes up fighting…
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574634)
 * Fork: Take someone else’s plugin. Make edits. Change the plugin name and version
   number so their updates don’t whack yours. Have a beer!
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574635)
 * I understood step 4 anyway… Will start there.
 *  [Modifiedcontent](https://wordpress.org/support/users/modifiedcontent/)
 * (@modifiedcontent)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/#post-2574815)
 * I’m trying to figure out the same thing and it is utterly ridiculous that this
   should require complicated custom coding or plugins.
 * Automattic apparently developed multisite for the WordPress.com use case; a network
   of blogs that are completely independent of eachother. That use case would make
   sense for maybe a big hosting company.
 * Normal people in the real world will almost never use multisite that way. Most
   will try to use WP multisite as a network for an organization or company, only
   to find out the hard way that letting “users” interact on the platform is virtually
   impossible.
 * Yes, being forced to add all users to the main blog is “a semantically sad use
   of the multisite framework”. In my case the main blog is used for organization
   news and announcement, so it’s the last place I want to have overrun by members/”
   users”.
 * So we’re supposed to use half-baked plugins and hacks to fix the mess again.
 * Can anyone give a basic example of a custom query to list all users in the ‘users’
   database table?

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/topic/wp_user_query-and-multisite/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wp_user_query-and-multisite/page/2/?output_format=md)

The topic ‘WP_User_Query and Multisite’ is closed to new replies.

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [wp_user_query](https://wordpress.org/support/topic-tag/wp_user_query/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 24 replies
 * 5 participants
 * Last reply from: [kirkward](https://wordpress.org/support/users/kirkward/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/wp_user_query-and-multisite/page/2/#post-2574878)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
