How to Bulk Delete Users in WordPress with Particular Roles

For a secure and efficient website, it is crucial to bulk delete users in WordPress with specific roles. Inactive or unnecessary users, like former contributors or admins, can clutter the user database and create security risks.

Deleting these users helps prevent unauthorized access, reduces spam, and enhances site performance. Updating WordPress to manage user roles when staff members leave, or permissions must be revoked.

When Should You Bulk Delete Users in WordPress

There are several scenarios in which you may want to bulk delete users in WordPress simultaneously from your WordPress blog or website:

  • Removing access for former employees or contractors is essential. If someone had special access to your site for a job but no longer requires it, you should delete their account.
  • Eliminating spam accounts is essential. If your WordPress site is overrun with fake accounts due to spam, take decisive action to delete them in bulk and restore its integrity.
  • Cleaning up old accounts is essential. Many inactive accounts can accumulate as your site grows, cluttering your user database. Deleting these accounts in bulk streamlines your site and conserves valuable space.

Do you know how to delete users in WordPress? Let’s dive into this.

1. Manually Deleting WordPress Users With Particular Roles

This method is straightforward and eliminates the need for WordPress plugins.

Navigate to the Users page in your WordPress admin area, where you will find the complete list of users registered on your website.

Users Page

At the top of the list, you will find links to various user roles. Press on a user role to view the list of users assigned to that specific role.

Keep in mind that this page displays only 20 users at a time. If you have additional user accounts to delete, press on the “Screen Options” tab in the top right corner of the screen.

This will open a dropdown menu, allowing you to set the “Number of items per page” as needed.

Screen Options

To delete users with the subscriber role, first note that there are 144 users with this role. Enter “144” in the ‘Number of items per page‘ field.

Then, press the ‘Apply‘ button to reload the page, which will display all user accounts assigned the subscriber role on your WordPress website.

Next, check the “Select All” checkbox next to the Username column to select all the displayed users.

Bulk Actions

If you wish to retain specific users, uncheck their boxes now. After you’re prepared, press on the “Bulk Actions” menu and choose “Delete.”

Then, press the “Apply” button, and WordPress will proceed to delete all selected user accounts.

If any accounts you’re deleting have created posts, you must decide how to handle those posts.

Delete Users

To delete user accounts in WordPress, you can either remove all content created by those users or attribute it to an existing user account.

Once you’ve selected it, press the ‘Confirm Deletion‘ button to proceed. WordPress will then delete all the selected user accounts from your site.

This method is suitable for a few hundred users, but if you have thousands, it’s advisable not to adjust the screen options, as this could overload your server.

Instead, you should consider using an alternative method.

2. Bulk Delete Users in WordPress With Particular Roles Using Plugin

The default method of bulk delete users in WordPress with specific roles is straightforward; however, it may only be effective if you have few users to remove.

Additionally, there are instances where you might want to select users based on different criteria.

For example, you might wish to delete users who haven’t logged in for an extended period or those who registered during a specific timeframe.

In such cases, more than the standard user management tools might be required.

Fortunately, there are plugins available that can help you efficiently carry out WordPress bulk user delete tasks.

The first step in deleting users with specific roles using a plugin is to install and activate the Bulk Delete plugin.

Once activated, navigate to the Bulk WP » Bulk Delete Users page» in your WordPress dashboard.

Bulk WP

You can use the ‘Bulk Delete‘ option to bulk delete users in WordPress. First of all, choose the specific user roles you want to include in the deletion process.

Then, choose your filtering options to restrict bulk deletion to users who:

  • Registered within a certain number of days.
  • Have not logged in for the last few days.
  • Do not have any posts on your WordPress blog.
  • Are among the first no. of users.

Additionally, you can choose users based on their metadata.

To do this, scroll down to the ‘By User Meta‘ box. Here, you can choose meta fields and apply conditional operators to compare their values.

By User Meta Option

Simply click the ‘Bulk Delete’ button and effortlessly bulk delete users in WordPress who meet your specific criteria. So take control of your WordPress user management today.

Always exercise caution during bulk deletions, as this action cannot be undone. Make sure to back up your website and user data before making any changes to avoid any unintended issues.

Conclusion

In the end, bulk delete users in WordPress with specific roles is crucial for effective user management and enhanced site security. Administrators can quickly identify and remove users using WordPress’s built-in features, plugins, or custom code.

This process helps keep your site streamlined and secure. Regular clean-ups are necessary for optimal performance, whether for security reasons, restructuring user permissions, or removing outdated accounts.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *