Delete users with attribute = x?

Questions about phpList features (the answer is probably 'Yes!')
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation. This is for Version 2 of phpList (the orange one).

Delete users with attribute = x?

Postby Chris44 » 7:19am, Sun 06 Jan, 2013

Hello,

I found some old threads about this but no current once.
Can I delete all users according to a value of an attribute?

Or should I simply use the table phplist_user_user?
Will it break any logic?
phplist_user_user_history?

Thank you
Bye, Chris
Chris44
phpList newbie
 
Posts: 3
Joined: 3:50am, Mon 17 Dec, 2012

Re: Delete users with attribute = x?

Postby duncanc » 5:30pm, Sun 06 Jan, 2013

I don't think that there is a function in phplist to do exactly what you want. Depending on how many users there are, you could use the Users page to find all those users with the required value of the attribute and then delete each user individually.

If you simply delete rows from the user table that will leave orphan rows in the related tables
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Delete users with attribute = x?

Postby Chris44 » 11:33pm, Sun 06 Jan, 2013

So what's my option if I have too many users to do it manually?
(couple of thousands)
Chris44
phpList newbie
 
Posts: 3
Joined: 3:50am, Mon 17 Dec, 2012

Re: Delete users with attribute = x?

Postby mrmckoy » 6:00am, Thu 10 Jan, 2013

Chris44 wrote:So what's my option if I have too many users to do it manually?
(couple of thousands)


there's no easy answer. you can get someone to write a script for you but that will still leave orphans. You best bet is to download a CSV and manipulate that data, isolating and unconfirming certain users.

Or unconfirming or blacklisting them in the SQL database. I wouldn't advise deletion
mrmckoy
PL Master
 
Posts: 169
Joined: 7:10am, Sat 24 Nov, 2007
Location: Atlanta, GA

Re: Delete users with attribute = x?

Postby duncanc » 9:02am, Thu 10 Jan, 2013

This approach should work, avoiding the need for direct database manipulation and ensuring that rows from related tables are deleted:
  • use the Users plugin http://forums.phplist.com/viewtopic.php?f=7&t=36455 to list and export all users with the attribute value
  • use manage users > mass unconfirm users to unconfirm those users - copy and paste the list of exported email addresses into the text box on that page
  • then use manage users > reconcile users to delete all unconfirmed users - at the bottom of the page

Of course this will also delete any existing unconfirmed users.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London


Return to Does phpList do this?

Who is online

Users browsing this forum: No registered users and 2 guests