Title: User loop problem
Last modified: March 8, 2022

---

# User loop problem

 *  Resolved [Arsalan](https://wordpress.org/support/users/sam3000us/)
 * (@sam3000us)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/user-loop-problem/)
 * Hello,
 * I’m using user loop shortcode to display members of specific user role, it works
   fine but the problem is if there is no user yet in that user role, it displays
   all the users from all the user roles!
    How to prevent this? I want it to display
   members of specific user role, if the user role is empty then display none.

The topic ‘User loop problem’ is closed to new replies.

 * ![](https://ps.w.org/userswp/assets/icon-256x256.png?rev=2784318)
 * [UsersWP - Front-end login form, User Registration, User Profile & Members Directory plugin for WP](https://wordpress.org/plugins/userswp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/userswp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/userswp/)
 * [Active Topics](https://wordpress.org/support/plugin/userswp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/userswp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/userswp/reviews/)

 * 0 replies
 * 2 participants
 * Last reply from: [Arsalan](https://wordpress.org/support/users/sam3000us/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/user-loop-problem/)
 * Status: resolved