Title: Filter User.php using Custom Roles
Last modified: August 22, 2016

---

# Filter User.php using Custom Roles

 *  Resolved [marshallsam](https://wordpress.org/support/users/marshallsam/)
 * (@marshallsam)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/filter-userphp-using-custom-roles/)
 * Hi,
 * I currently use the latest version of User Role Editor and I have generated a
   number of custom roles which are displayed under the user.php page as separate
   roles as expected.
 * However I would like it so that when a certain role is signed in they can only
   see that role’s users on the user.php (for example – signed in as a customer 
   they can only see other customers). I appreciate that this can be achieved by
   role (?role=distributor) however I would like it to filter the all listing as
   well.
 * I appreciate that this maybe outside of the plugin, however I would greatly appreciate
   support with this to allow both the plugin and core system to work together.
 * Thank you in advance,
 * Sam
 * [https://wordpress.org/plugins/user-role-editor/](https://wordpress.org/plugins/user-role-editor/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/filter-userphp-using-custom-roles/#post-5443517)
 * Hi Sam,
 * This feature is available in the Pro version
    [https://www.role-editor.com/other-roles-access/](https://www.role-editor.com/other-roles-access/)
   If you block all roles except the current one, you will get the described result.
   User with ‘list_users’ capability will see users with the same role only.
 *  Thread Starter [marshallsam](https://wordpress.org/support/users/marshallsam/)
 * (@marshallsam)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/filter-userphp-using-custom-roles/#post-5443520)
 * Hi Vladimir,
 * That sounds really promising.
 * After reading the article, would the user just be greyed out (no edit or view
   options) or users are completely removed from the table including the ‘all users’
   table (the solution I am after)
 * If this is correct, I will go ahead and get the pro version.
 * Thanks,
 * Sam
 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/filter-userphp-using-custom-roles/#post-5443521)
 * Hi Sam,
 * This is right: users are completely removed from the table including the ‘all
   users’ table.
 *  Thread Starter [marshallsam](https://wordpress.org/support/users/marshallsam/)
 * (@marshallsam)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/filter-userphp-using-custom-roles/#post-5443546)
 * Hi Vladimir,
 * That worked perfectly.
 * Many Thanks,
 * Sam

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Filter User.php using Custom Roles’ is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [user.php](https://wordpress.org/support/topic-tag/user-php/)

 * 4 replies
 * 2 participants
 * Last reply from: [marshallsam](https://wordpress.org/support/users/marshallsam/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/filter-userphp-using-custom-roles/#post-5443546)
 * Status: resolved