Title: Unapproved issue
Last modified: April 18, 2024

---

# Unapproved issue

 *  Resolved [reesebrown2](https://wordpress.org/support/users/reesebrown2/)
 * (@reesebrown2)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/unapproved-issue/)
 * When i look at my lis of users, is see that I have a large number unapprove. 
   When I click on unapporve, it says No Users Found, but i know i have many.
 * Any help with how to see them would be great.

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

 *  [Gerard Reches](https://wordpress.org/support/users/gerardreches/)
 * (@gerardreches)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/unapproved-issue/#post-17812960)
 * +1.
 * The **/wp-admin/users.php?role=wpau_unapproved** page where all the unapproved
   users should be listed, is empty even though the user count says there are unapproved
   users. I can confirm that there are, in fact, unapproved users. I’ve tested unapproving
   some of them and the count increases but the list still says no users found.
 * From the URL you can tell that it’s trying to filter the users table by the role**
   wpau_unapproved**. However, when I check the metadata of the **unapproved user**,
   the **wp_capabilities** meta **does not contain the wpau_unapproved role**, only
   the subscriber role.
 * Since the role is not being assigned to unapproved users, they are not being 
   displayed on the Unapproved users list.
 * The **wp-approve-user** meta is present for the user, with an empty value. I 
   understand that the unapproved users count comes from this meta and this is the
   one storing the approval status.
 * Therefore, we need a fix for either correctly assigning the role or a different
   way to display the unapproved users based on the **wp-approve-user** meta instead
   of the **wpau_unapproved** role.
 * WordPress and plugins up to date. Using the plugin **User Role Editor** as well.
   PHP 8.1.
 * The plugin used to work, so something must have changed.
 *  [Gerard Reches](https://wordpress.org/support/users/gerardreches/)
 * (@gerardreches)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/unapproved-issue/#post-17815927)
 * The plugin uses the **pre_user_query** action hook on line 231 of the file **
   class-obenland-wp-approve-user.php**
 * There is something going on in there that makes the unapproved users listing 
   page to not work, and it even looks like it has to deal with some issues causing
   an infinite loop and the page not loading at all.
 * I have fixed it by adding this code to my site:
 *     ```wp-block-code
       public function fix_wpau_filter( WP_User_Query $query ) {    if ( ! is_admin() ) {        return;    }    global $pagenow;    if ( $pagenow !== 'users.php' || ! isset( $_GET['role'] ) || $_GET['role'] !== 'wpau_unapproved' ) {        return;    }    $query->set( 'role', '' );    $query->set( 'meta_query', array(        array(            'key'   => 'wp-approve-user',            'value' => false        )    ) );}add_action( 'pre_get_users', 'fix_wpau_filter', 10, 1 );
       ```
   
 * With this, I can remove the plugin’s function code and the unapproved users page
   displays all unapproved users properly. The plugins function can be removed, 
   but it will also work without removing it. This means that the developer should
   drop the use of the **pre_user_query** and use **pre_get_users** instead. He 
   can make an adaptation of the code I’ve provided.
 * If you are someone experiencing this issue, just add the code I’ve provided to
   your functions.php, you don’t need to do anything else.
 * I hope the author of the plugin can fix this soon so that we don’t require this
   fix anymore.
 *  Plugin Author [Konstantin Obenland](https://wordpress.org/support/users/obenland/)
 * (@obenland)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/unapproved-issue/#post-17845074)
 * I’ve not been able to reproduce this on a fresh installation of latest WordPress
   on PHP 8.1.
 * [@gerardreches](https://wordpress.org/support/users/gerardreches/) When did this
   behavior change? Have you tried troubleshooting with other plugins disabled?

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

 The topic ‘Unapproved issue’ is closed to new replies.

 * ![](https://ps.w.org/wp-approve-user/assets/icon-256x256.png?rev=3013178)
 * [WP Approve User](https://wordpress.org/plugins/wp-approve-user/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-approve-user/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-approve-user/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-approve-user/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-approve-user/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-approve-user/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Konstantin Obenland](https://wordpress.org/support/users/obenland/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/unapproved-issue/#post-17845074)
 * Status: resolved