Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+7 votes
12.3k views
in Q2A Core by
I see that one may  ban users for a period of time; is it possible to delete them and all their votes and  posts? Is it possible to delete them and their votes but not their posts?
related to an answer for: Can we ban people?
ago by
In fact, it seems User Manager has a problem with PHP 8. This was recorded in September 2023 in the issues for the project "Since PHP Version 8 and up, it shows a white page.
Is there any chance you could update the plugin?". There is so far no response. As I am running on the current release of Debian which has PHP 8.2 I cannot use the User Manager plugin.

2 Answers

+13 votes
by
selected by
 
Best answer

Of course you can delete the user. To delete the user you must have to block him/her first. Once user is blocked the delete button will appear.

  • Go to Main navigation >  Users > and select the user you want to see the profile
  • At the bottom you will find Block user button
  • Once you blocked the user the Delete button will appear also Hide all posts by this user button.
  • Now Hide all posts by this user (if you want to delete all questions and answers)
  • Now hit Delete to delete the user (make sure it will delete the user without any warning before action)
  • Now go to Admin > Stats and hit the Delete Hidden Posts button (this will delete all questions,answers,comments from the user)
  • Now recount and recalculate all stuffs to take affect everything in the system.

Done!

It is always good idea to take database backup before you do anything.

by
Thank you! Thanks a lot.
by
Great answer!
by
+1
Desparately need a bulk user delete option (or checkbox to select and delete users) - I have setup a site and there are already 1000 spam users registered and confirmed email
by
Do you use recaptcha or other captcha in user register page?
by
OK, but how do you actually find a user? Main navigation -> Users shows only 20 users and no search facility. I have thousands of users, it isn't remotely feasible to page through 20 at a time. What's more, if someone asks to be removed from the system (exercising their legal right) all I have to start off with is their email address. And the Users list shows only usernames. While in many ways excellent, the system badly needs improved administration of users.
by
Even though the ability to search for users makes sense, there is a decent workaround which would be asking the user you want to delete for the username or the URL to their profile. You can't just delete a user without knowing which user to delete.
by
Improved user administration already exists in form of the User Manager plugin, which among other things allows to search for (partial) usernames and e-mail addresses. Check the plugins listing in the documentation.
ago by
Thanks for the suggestions. It's useful to be reminded that the user profile can be accessed using the username. Although I still think there should be much better user administration. User Manager sounds good, but is not mentioned on the Q2A plugins page. It hasn't been updated for at least 6 years, and when I installed it, only a blank page was displayed (and no error in the log). So I still feel better facilities are needed.
0 votes
ago by
Yes, users can be deleted, blocked or hidden.

Based on your follow-up comments, here is what you may want to do. First you need to find the user(s) that you want to delete

1.) To find the users, you can install this plugin:

https://www.q2apro.com/plugins/usersearch

Which displays a search box on the users page that you can use to search the users by their username(s), that is if you know their username.

 Also you can search the users by their email address by adding these simple lines of code to the plugin:

https://www.question2answer.org/qa/57068/how-to-search-q2a-users-by-email-or-username-as-an-admin?show=57153#c57153 (only admin will be able to search by email, registered users can only search other users by their usernames).

2.) To expand the user listing page to more than 20, go to admin→lists→ and change the length of users page to 100 (max is 200).

3) You can find new users by logging into your site and going to the users page then click on the "new users" tab.

4.) Once you know the users (either by searching through email or username or from browsing the listing page) you can go to the user's profile and click the "block user" button below the profile which will then avail the option for "Delete user".
...