Get Users List by Role in WordPress

  1. Home
  2. Knowledge Base
  3. WordPress Hacks
  4. Get Users List by Role in WordPress

WordPress have 6 role :

  • Super Admin
  • administrator
  • editor
  • author
  • subscriber
  • contributor

You can add custom role for user in WP (WordPress Create Custom Roles and Capabilities).

If you want to get all users of wordpress you can use this following code. These code print all wordpress user’s list.

For Example : Display all User Email in subscribers role

if you want get user data from specific user role, you can change 'role' => 'subscriber' in line 3 to specific user role.

Was this article helpful?

Related Articles

Leave a Reply