Support » How-To and Troubleshooting » Possible bug in user count, WordPress Admin

Possible bug in user count, WordPress Admin

  • I’ve just noticed I’m seeing a strange number in my number of users in /wp-admin/users.php

    It reports I have:

    All (17) | Administrator (16) | Contributor (1)

    but the list only shows 1 contributor and 3 administrators (I created all these user accounts, so there’s no security breach there)

    I’ve checked the database, and there are only 4 users in the [prefix]_users table.

    Where do these numbers come from, and why might they be miscounting?

Viewing 1 replies (of 1 total)
  • The user count you mention uses a function called count_users, located in wp-includes/user.php.

    If you take a look at the function’s code, you’ll see some comments there. It says that the function:

    * Assumes there are neither duplicated nor orphaned capabilities meta_values.
    * Assumes role names are unique phrases.

    I would bet that one or more of the mentioned assumptions were not met in you case.

    I also experienced this issue and found it to be caused by the fact that I deleted some users directly from the database, omitting to also delete their meta_values. Orphaned meta_values it’s called, apparently.

Viewing 1 replies (of 1 total)
  • The topic ‘Possible bug in user count, WordPress Admin’ is closed to new replies.
Skip to toolbar