Title: WordPress users count and meta data problems
Last modified: August 22, 2016

---

# WordPress users count and meta data problems

 *  [flowerheart](https://wordpress.org/support/users/flowerheart/)
 * (@flowerheart)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-users-count-and-meta-data-problems/)
 * Hi Everyone,
    I need some help with wordpress users meta data.
 * I was recently hit by a Spam bot attack and had about 300 users registered on
   my site + 50,000 posts created because I had changed the defaults unkowingly.
 * Since then I have cleaned up the posts from the SQL database and for users since
   I could not figure out the proper way to do it, I deleted them one by one from
   the sql table interface through the Cpanel php admin.
 * As a result now I am down to 91 real users on my site but on the front end it
   still shows 300 odd users. Is there anyway to clean up the metadata so the totals
   in the front end interface are right.
 * Thanks in advance for any help.

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

 *  [Lucas Karpiuk](https://wordpress.org/support/users/karpstrucking/)
 * (@karpstrucking)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-users-count-and-meta-data-problems/#post-5708214)
 * The user count is generated from user meta, so you’ll need to clean that up:
 *     ```
       DELETE
       FROM wp_usermeta
       WHERE user_id NOT IN (
       	SELECT ID from wp_users
       )
       ```
   
 * (Change your table names accordingly if you’re using a prefix other than `wp_`)
 * As always, back up your usermeta table before running this – just in case.
 *  Thread Starter [flowerheart](https://wordpress.org/support/users/flowerheart/)
 * (@flowerheart)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-users-count-and-meta-data-problems/#post-5708313)
 * My friend, THanks , Merci, Dhanywaad , Shukriya
 * Thanks for showing the way it worked beautifully,
 * First tried it with SELECT and then repeated with DELETE.
 * Excellent stuff.

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

The topic ‘WordPress users count and meta data problems’ is closed to new replies.

## Tags

 * [spam registration](https://wordpress.org/support/topic-tag/spam-registration/)
 * [users](https://wordpress.org/support/topic-tag/users/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [flowerheart](https://wordpress.org/support/users/flowerheart/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-users-count-and-meta-data-problems/#post-5708313)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
