How To Bulk Delete WordPress Users Based On Their Role

If you want to delete users from your WordPress then you can’t remove more than 20 users at a time. You would have to go through every single page to delete every single one of them. We have a simple script which will allow you to bulk delete WordPress users based on their role. All you need to do is just run this script and that’s it.

Just put any of the following code to functions.php file of your current theme to bulk delete users of that role:

[alert style=”red”]Note: Please remove these codes immediately after saving your functions.php file. You only need to run these codes once, there’s no need to keep these codes in your theme.[/alert]

For Admin

For Authors

For Editors

For Contributors

For Subscribers