By ckeen on
Hello there are about 4000 users I want to remove from my current website... I am wondering if there is a quick way to do that?
With the user import module I can upload a .CSV file to add a bulk number of users.... but what I want to do is to delete users using this same .csv if that is possible?
Comments
Do the users you want to
Do the users you want to remove have anything in common or are they just random users? If they're all registered but not verified the Logintoboggan module can automatically clear out unverified users after a set time frame. Otherwise you could write an SQL script to remove the users directly from your database.
Well the only thing they have
Well the only thing they have in common is that they were uploaded via a CSV. I uploaded them using the User Import module but I made a mistake and I want to remove them via the same CSV file.
IMHO, the quickest method is
IMHO, the quickest method is using PHPMyAdmin and run this command:
- delete from users where created >= 'x1' and created <= 'x2'
x1 and x2 = time-stamp when you insert users from your CSV file
Another method is upload again your CSV to new table, i,e: users_csv, then run this command:
- delete users, users_csv from users where users.uid = users_csv.uid
I would not recommend
I would not recommend removing data directly from the DB unless you know precisely what you are doing. There is an API function for this: http://api.drupal.org/api/function/user_delete/6 and it is more complicated then the above post.
There is no quick way to do this, but to write a bit of code to parse a CSV file and then run user_delete on each would be a fairly simply task for a Drupal coder. That is how I would recommend to do this.
I'm pretty nub and I'm still
I'm pretty nub and I'm still very beginner in terms of Drupal... i've create dfairly complex websites using ONLY modules with NO PHP experience whatsoever... I may have to experiment with the SQL command thing or do it manually :S