Title: delete all users from the users table
Last modified: August 21, 2016

---

# delete all users from the users table

 *  Resolved [Bloke](https://wordpress.org/support/users/bloke/)
 * (@bloke)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/delete-all-users-from-the-users-table/)
 * I need a SQL script I can run in phpMyAdmin to delete all users from the users
   table and also all meta tables from wp_usermeta with capabilities of wpsc_anonymous.
   The issue with Wp-ecommerce causing many wpsc_anonymous users is too much. [Link](http://wordpress.org/support/topic/spam-users-in-wp_users-after-wpsc-upgrade)
   I know they are working on it and sometimes the cron runs and clears most of 
   them. I have to delete each user and then go and delete each one from wp_usermeta
   table.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Bloke](https://wordpress.org/support/users/bloke/)
 * (@bloke)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/delete-all-users-from-the-users-table/#post-4741006)
 * I found this solution. I ran this in phpMyAdmin
 * DELETE FROM wp_users WHERE ID > [number after last real user]
 * Then run this:
 * DELETE FROM wp_usermeta WHERE user_id NOT IN (SELECT ID FROM wp_users)

Viewing 1 replies (of 1 total)

The topic ‘delete all users from the users table’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Bloke](https://wordpress.org/support/users/bloke/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/delete-all-users-from-the-users-table/#post-4741006)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
