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?

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

A query:

DELETE FROM exp_members WHERE last_visit = 0
| improve this answer | |
  • 1
    You'd want to add a check for 'pending' in that WHERE statement if you're going for an SQL Query. – nonprofit_tech Dec 4 '12 at 2:09
  • Good point, thank you. The site I use this on doesn't validate members manually. – Christy Collins Dec 4 '12 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!)

| improve this answer | |
  • Andrew's just awesome. I'm always deleting pending members, will have to give this ago. – nonprofit_tech Dec 4 '12 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.

| improve this answer | |
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.

| improve this answer | |
  • Unfortunately, my purgedata plugin will only handle entries not members – Andrew Weaver Dec 4 '12 at 12:26
  • I thought that might be true. – nonprofit_tech Dec 4 '12 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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