delete users

Sometimes when launching a site you need to import users from another site. User Import module makes that job quite simple. A year goes by and request comes in to delete all imported users who have never logged in. You have the following options:

  • User Prune
    • pros - deletion based on criteria
    • cons - no batch API
  • Custom module with hook_cron implementation
    • pros - very customizable, allows calling user_delete
    • cons - depends on cron running frequency and capacity

If neither of these options fit and there is no button clicking money around to submit a form hundreds of times to delete users manually one might be tempted to bypass Drupal and PHP completely by executing a query in the db.

Note - I do not recommend this option.