4

EE v1.x had nice tools to prune data. EE 2.x seems to have removed these features.

What I want to do is delete Pending user accounts (never activated their account). I can go through and manually delete them 50 at a time. Not fun. Even less fun when the site gets hit by a spambot.

Are there any add ons that do this? Proven methods that get right into the database?

1
  • I could not tag it with 'pruning' since my rep is too low. Someone care to add that tag?
    – Doug
    Commented Dec 4, 2012 at 0:05

4 Answers 4

5

A query:

DELETE FROM exp_members WHERE last_visit = 0
2
  • 1
    You'd want to add a check for 'pending' in that WHERE statement if you're going for an SQL Query. Commented Dec 4, 2012 at 2:09
  • Good point, thank you. The site I use this on doesn't validate members manually. Commented Dec 4, 2012 at 16:28
5

Member data is stored in (at least) 3 tables: exp_members, exp_member_data and exp_member_homepage.

You can use SQL to delete the members from these tables.

The safest way to delete them is to the the member model's delete_member method. This will make sure any relevant extensions are also run, clean up all the database tables (eg, if the member had posted an entry or comment) and update any stats.

$this->EE->load->model('member_model');
$this->EE->member_model->delete_member( $member_id_array );

I've built a very quick plugin to delete pending members here: https://bitbucket.org/ajweaver/ajw_delete_members

(I have tested it, but please take a database backup before trying it!)

1
  • Andrew's just awesome. I'm always deleting pending members, will have to give this ago. Commented Dec 4, 2012 at 13:09
2

It's a little misleading but, there is a 'Delete Selected' option in the drop-down menu on the Activate Pending page.

1

BrandNewBox has a tool to purge data, http://brandnewbox.co.uk/products/details/purgedata I've never used it to prune members, but have used it to remove records from entries. You could give that a try.

2
  • Unfortunately, my purgedata plugin will only handle entries not members Commented Dec 4, 2012 at 12:26
  • I thought that might be true. Commented Dec 4, 2012 at 13:10

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.