PDA

View Full Version : Removing Duplicate Users


adambloch
11-17-2012, 06:03 PM
Hi all

I have a little problem that up till now hasn't been an issue. At somepoint in the past we must have done something that has created 2462 duplicate users. Having said that they all have a prefix on the duplicate accounts of imported_ so they are quite easy to indentify.

Does anyone have a suggestion in how to remove these 2462 users.. I'm guessing that doing it via the DB is a bad idea but may be not.

Many thanks

Adam

kh99
11-17-2012, 06:34 PM
I've seen people suggest that you simply remove the rows from the user database, and I think that might work (especially is the users have no posts), but it doesn't remove everything. What I usually suggest is something like this: create a new (temporary) usergroup, then execute a query like this:
UPDATE user SET usergroupid=X WHERE username LIKE 'imported_%'


where you replace the X with the id of your temp group. Then go to "Users > Move/Prune users" and delete all the users from that usergroup.

As always it's a good idea to have a db backup before doing things like this.

adambloch
11-17-2012, 08:57 PM
Thank you :) you just save me having to go through them 1 by 1 :)

Many thanks

Adam