Deleting user accounts
Moderators: Developer, Contributor
Deleting user accounts
There are accounts on my system that were created in 2011 and last used in 2011. How can I delete all accounts that were last used before 1 January 2016?
Re: Deleting user accounts
As an example, check manage_user_prune.php to see how to delete users who have never logged in and are older than 1 week.
Keep in mind that
- there is no other undo after deleting users, than to restore a database backup
- wherever the deleted user is referenced (e.g. issues he created, notes he added), you will see the user name as a striked through User<ID>
So maybe you better just deactivate users instead of deleting them.
Keep in mind that
- there is no other undo after deleting users, than to restore a database backup
- wherever the deleted user is referenced (e.g. issues he created, notes he added), you will see the user name as a striked through User<ID>
So maybe you better just deactivate users instead of deleting them.
Re: Deleting user accounts
Thanks. I don't see the point of having users in my database who have not used the resource in years.
But i don't want to fiddle with writing any PHP script or using phpadmin.
I would be much more comfortable with a user interface approach.
But i don't want to fiddle with writing any PHP script or using phpadmin.
I would be much more comfortable with a user interface approach.
Re: Deleting user accounts
Hi Atrol, I was thinking along the same lines as the OP. But now that you mentioned deactivating users, I was wondering can you reactivate a deactivated user again?
Here are some of the best crossbows money can buy.
Re: Deleting user accounts
You can. Use Manage > Manage Users page for it. Enable check box "Show Disabled", click "Apply Filter" and order by column "Enabled"
Re: Deleting user accounts
I don't think deleting them would be the best idea. Maybe putting them in a dormant mode would be the best option because you can reactivate whenever you want.
-
- Posts: 111
- Joined: 05 Jun 2019, 00:17
Re: Deleting user accounts
the mistake I was made by accidentatrol wrote: ↑04 Nov 2018, 09:38 As an example, check manage_user_prune.php to see how to delete users who have never logged in and are older than 1 week.
Keep in mind that
- there is no other undo after deleting users, than to restore a database backup
- wherever the deleted user is referenced (e.g. issues he created, notes he added), you will see the user name as a striked through User<ID>
So maybe you better just deactivate users instead of deleting them.

Is possible to re-add the deleted user through phpmyadmin? (same id, user name, email, etc.,)
I've tried, but get the #1062 error and don't know how to fixed it.
Re: Deleting user accounts
error 1062 stands for duplicate row (dupilicate primary key) , seems you try to add a user which is already there 
