Do you want to delete WordPress users with specific roles from your website or WooCommerce store?
While you can go to the Users page and delete each user one by one, it’s not a great option if you have a lot of users.
In this article, we will show you how to bulk delete WordPress users with specific roles.
Method 1: Manually Deleting WordPress Users With Specific Roles
This method is simpler and does not require you to install any WordPress plugins.
Simply go to the Users page in your WordPress admin area. You will notice the list of users registered on your WordPress website.
On top of the list, you will see the links to different user roles. When you click on a user role, it will show you the list of users with that specific user role.
This page only displays 20 users at a time. If you have more user accounts that you want to delete, then click on the Screen Options tab in the top right corner of the screen.
This will show a dropdown menu where you can set the ‘Number of items per page’.
For example, we want to delete users with the subscriber user role, and there are 144 users with that role. So, we will enter 144 in the ‘Number of items per page’ field.
Just click on the ‘Apply’ button, and the page will reload, showing all user accounts with the subscriber user role on your WordPress website.
Now you need to click on the Select All checkbox next to the Username column to select all items displayed on the page.
If you don’t want to delete some users, then you can uncheck their boxes now.
Once you are ready, simply click on the ‘Bulk Actions’ menu and then select ‘Delete’. After that, click on the ‘Apply’ button, and WordPress will delete all selected user accounts.
If the user accounts you are trying to delete have created posts, then you will be asked what you want to do with those posts.
You can select to delete all content created by those users or attribute it to an existing user account.
Finally, click on the ‘Confirm Deletion’ button to continue. WordPress will now delete all selected user accounts from your site.
This method will work for a few hundred users, but if you have thousands of users, then you don’t want to adjust the screen options because it can potentially overload your server.
Instead, you need to use method #2.
Method 2: Bulk Delete WordPress Users With Specific Roles Using Plugin
The default way to bulk delete users with specific roles is quite simple, but it isn’t suitable if you have a very high number of users that you want to delete.
Plus, sometimes you may need to select users based on other criteria as well.
For example, you may want to delete users that haven’t logged in for a while or who signed up during a specific period of time.
In such a situation, the default user management tools will not be enough. Luckily, there are plugins that allow you to efficiently perform bulk tasks.
Let’s see how to delete users with specific roles using a plugin.
Upon activation, you need to visit Bulk WP » Bulk Delete Users page in your WordPress dashboard.
Here you can select the ‘Bulk Delete’ option for deleting users. First, you can select the specific user roles. After that, you can select the filtering options.
You can restrict bulk delete to users who:
- Have registered in a given number of days.
- Haven’t logged in the last __ of days.
- Don’t have any posts on your WordPress blog.
- Are first __ users.
You can also select users by meta data.
Scroll down a little to the ‘By User Meta’ box. In this box, you can select meta fields and use conditional operators to compare their values.
Just click on the ‘Bulk Delete’ button, and the users matching the specific criteria will be deleted.
We hope this article helped you learn how to bulk delete WordPress users with specific roles. You may also want to see our tutorials on how to allow blog users to moderate comments in WordPress and how to pick the best free user management plugins for WordPress.