Drupal - How to delete 'blocked' users in bulk?

On the People page (admin/people), first select the blocked users and then from the update options select Cancel the selected user accounts. (Drupal 7)

Another way is using the Views Bulk Operations module.


Deleting users directly from database is not a good idea. either done through drush or by interacting directly with the database through SQL DELETE. Some modules, for instance, create robot users and these tend to be blocked. Just deleting them may interfere with the module's operation and even make the module fail, leaving you with orphaned data and inexplicable error messages.

When spam registrations appear as "blocked" users, they're blocked because their accounts remain unverified (spammers, as a rule, never verify, so their accounts never progress from the blocked status).

A project named LoginToboggan gives you the option to have unvalidated users purged from the system at a pre-defined interval. This will also take care of any spammers that register in the future, without making it necessary to introduce protective measures such as CAPTCHA, that tend to discourage legitimate users from signing up.

Using LoginToboggan to bulk-remove spam users is much safer and more robust than hacking the database yourself.

If you don't want to install a module to do this, as an alternative, you can delete the unverified users using drush and user_delete().


Or use this module advance user module and token module and open people menu in drupal admin and see the advance tab menu and delete bunch of user records.

https://www.drupal.org/project/advuser

and

https://www.drupal.org/project/token

Tags:

Users