I've picked up an old EE 1.6 site that has 58k spam member accounts. Anybody got a safe way to delete them all without going through every paginated screen in the CMS? It's on a live server but I suppose I could edit the SQL to change pagination.

I'd rather do it directly in myqsql though I think, but I want to make sure no table relationships are broken.

  • 1
    Are you deleting all the members or just specific ones? Commented Feb 25, 2013 at 11:53
  • 1
    Indeed - is there a specific criteria you are using to determine who is a spam account and who is not? Commented Feb 25, 2013 at 13:37
  • 1
    I just had to do this the other day. Can't remember the exact queries I used, but here is what I did: 1. delete all members in the Pending member group 2. delete all members whose last_visit date wasn't set 3. Find common spammy email domains and then delete from exp_members, exp_member_homepage, exp_member_data where the email address contains that spammy domain. But, I didn't know about the member account pruning, so you may want to start there. Commented Feb 25, 2013 at 19:50
  • Basically ALL members in the group 'Members' can be binned as we don't use that group at all.
    – Russ Back
    Commented Feb 26, 2013 at 13:50

3 Answers 3


If the members you are deleting have something simple in common (e.g. They never logged-in ) then you can use the member clean up tools - these might work for you.

Go CP Home › Admin › Utilities › Data Pruning › Membership Account Pruning

Obviously back-up first before even looking at this and YMMV but for EE 1.6 the data pruning might be handy.

  • This is what I would recommend.
    – CreateSean
    Commented Feb 25, 2013 at 21:27
  • Good shout. I'll give that a go and update the question with the result
    – Russ Back
    Commented Feb 26, 2013 at 14:10
  • It works. Sadly the script times out a lot but if you do it in reasonably sized batches it works OK. Thanks guys
    – Russ Back
    Commented Feb 27, 2013 at 15:43

The easiest way to delete 1000s of members is to use the following SQL after backing up your database:

FROM `exp_members`
WHERE `group_id` =x

x is the member group number you want to delete members from.

  • Thanks fmz I removed about 300K users from my site with that SQL command. I backed up before tho. DB was 140MB compressed. Is now just 5mb compressed,
    – Warry
    Commented Sep 6, 2013 at 8:52

I would think your best bet is backing up the DB in production, writing a script to test the removal on your local machine, performing the update on your local machine, importing the changes back to the DB.

You might have to do a site-wide content freeze for a few hours, but that's pretty standard in situations like this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.