Possible to delete multiple users at once?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
sc123
Registered User
Posts: 52
Joined: Fri Jul 20, 2007 6:12 am

Possible to delete multiple users at once?

Post by sc123 »

Is there a way to display a list of users and "select all" or something of that nature to delete them? In phpbb 2.0 I installed a mod to do this from a member list but I can't find anything like that for 3.0.
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Possible to delete multiple users at once?

Post by karlsemple »

You can delete multiple users by using the prune users feature in the Admin control panel -> users and groups tab -> users security -> prune users

Please backup before using this feature as it is powerful and no going back after using it :)
Image
sc123
Registered User
Posts: 52
Joined: Fri Jul 20, 2007 6:12 am

Re: Possible to delete multiple users at once?

Post by sc123 »

Pruning doesn't seem to allow me to choose users from a list or delete multiple users at once by choosing the users. I can't just remove users using criteria like "joined before a certain day". I just need to be able to select from a list and delete multiple users at once.
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Possible to delete multiple users at once?

Post by karlsemple »

sc123 wrote:Pruning doesn't seem to allow me to choose users from a list or delete multiple users at once by choosing the users. I can't just remove users using criteria like "joined before a certain day". I just need to be able to select from a list and delete multiple users at once.

look at the prune section again...there is a find a member list which will allow you to select multiple users and then prune them away
Image
sc123
Registered User
Posts: 52
Joined: Fri Jul 20, 2007 6:12 am

Re: Possible to delete multiple users at once?

Post by sc123 »

Thanks - I just assumed that link would bring up the same interface as the other with the same name that doesn't allow you to select multiple users.
dmarsiglio
Registered User
Posts: 1
Joined: Sat May 17, 2008 2:12 am

Re: Possible to delete multiple users at once?

Post by dmarsiglio »

Thanks for the thread. It sounds like you've had some success. But i can't seem to find the 'users and groups tab'. Where is that exactly? (sorry i'm quite new to phpBB)
sc123
Registered User
Posts: 52
Joined: Fri Jul 20, 2007 6:12 am

Re: Possible to delete multiple users at once?

Post by sc123 »

In your Admin Control Panel (ACP) the "Users and Groups" tab is at the top to the right of "Posting". You probably aren't even logged into the ACP if you don't see it.

Log into your forum as an admin user and look for the ACP link at the bottom of the page.
User avatar
PhilEsq
Registered User
Posts: 117
Joined: Sun May 22, 2005 3:14 pm
Location: U.S.A.
Contact:

Re: Will it also delete the posts?

Post by PhilEsq »

Will pruning also delete the posts associated with the users?
Philip L. Franckel, Esq.
www.HURT911.org
User avatar
PhilEsq
Registered User
Posts: 117
Joined: Sun May 22, 2005 3:14 pm
Location: U.S.A.
Contact:

Re: Will it also delete the posts?

Post by PhilEsq »

I just answered my own question. You can delete all the posts also.
PhilEsq wrote:Will pruning also delete the posts associated with the users?
Philip L. Franckel, Esq.
www.HURT911.org
castorcanadensis
Registered User
Posts: 42
Joined: Thu Apr 09, 2009 9:22 pm

Re: Possible to delete multiple users at once?

Post by castorcanadensis »

"look at the prune section again...there is a find a member list which will allow you to select multiple users and then prune them away"

I can't find this. Can you explain where it is, please?

Thanks
Graham.
Markstar
Registered User
Posts: 72
Joined: Mon May 01, 2006 6:26 pm

Re: Possible to delete multiple users at once?

Post by Markstar »

castorcanadensis wrote:"look at the prune section again...there is a find a member list which will allow you to select multiple users and then prune them away"

I can't find this. Can you explain where it is, please?

Thanks
Graham.
Administration Control Panel -> Users and Groups -> Prune users -> Under the "Prune users" field is a link "Find a member".

I have my own question as well: Can I simply delete unwanted users (who have made no posts) from the "users" table in the database?

Thanks in advance!
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Possible to delete multiple users at once?

Post by stevemaury »

ABSOLUTELY NOT!!!

There are entries for them in other tables, whether they have posted or not.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
tunkkaamo
Registered User
Posts: 8
Joined: Sat Dec 08, 2012 7:45 pm

Re: Possible to delete multiple users at once?

Post by tunkkaamo »

stevemaury wrote:ABSOLUTELY NOT!!!

There are entries for them in other tables, whether they have posted or not.
I tested following on a test server where i have a backup of the actual:

Lets say you want to see all users who have registered before 1.1.2012 and have zero posts and zero private messages.
In mysql command line:


SELECT username,user_last_privmsg,user_posts FROM phpbb_users WHERE user_regdate < 1345766400 AND user_posts=0 AND user_last_privmsg=0;

Then you get a list of those unactive users, registered about one year ago.
1345766400 is 1.1.2012 00:00:00 in Unix format.
You can convert normal dates to Unix format here: http://www.epochconverter.com/

If you are happy with your result from the SELECT statement, you can delete the users with following statement:

---USE AT YOUR OWN RISK!!!!
[Under no circumstances should you actually do this. We will not be able to help you if you do - Marshalrusty]
DELETE FROM phpbb_users WHERE user_regdate < 1345766400 AND user_posts=0 AND user_last_privmsg=0;

---USE AT YOUR OWN RISK!!!!

Like I said, I did run this on a test server, and the board was running ok after deleting a couple of thousand zero posts and zero private messages users.

You said the above script is not ok and might brake relations to other tables?
Is there any documentation to this as I really would like to use the script on a live site.
User avatar
Lumpy Burgertushie
Registered User
Posts: 69224
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Possible to delete multiple users at once?

Post by Lumpy Burgertushie »

I wonder why you don't belive the support staff when they say something. they are the ones that know how phpbb works.

just because the board is still working does not mean that what they said is incorrect. each time a user is created there are entries into several different tables in the database. if you only delete the entries from the users table you are leaving all those others and it could easily cause problems down the road.

now, why do you not wish to use the method provided in the admin panel for pruning/deleting users?

had you done so in this case, it would already have been done by the time you could connect to the database and run your query and then run the nex query etc.

and, it would have been done correctly the way the board was designed to work.

luck,
robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Possible to delete multiple users at once?

Post by stevemaury »

Note that, among other issues, your query does not clean up the user_group table. That means if the Newly registered users group is used, whether it is or isn't the default, you will have a non-existent user_id in the user_group table.

Other issues are if the user has posted in a forum that does not increment post counts, or if the user has unapproved posts.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
Locked

Return to “[3.0.x] Support Forum”