Delete multiple users

Delete multiple users

by Clint Lalonde -
Number of replies: 24
Just playing around with Moodle and wondering - is there a way to delete multiple user accounts without having to go into the db? I can't see any multiple delete function from the admin interface. Thanks
Average of ratings: -
In reply to Clint Lalonde

Re: Delete multiple users

by Ruediger Walden -
Hello,
I'm interested on a solution too, because I'm not very familiar with db handling.

And I would like to have functionality of automatic deleting users after a given period of inactivity in addition to Clint's question.

Thanks a lot
In reply to Ruediger Walden

Re: Delete multiple users

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
As far as I know, neither of these two things is possible without modifying the code. sad

Saludos. Iñaki.
In reply to Ruediger Walden

Re: Delete multiple users

by Nicola Bennett -

Hello,
I also have over 100 users I want to delete. I don't want to have to delete each one manually. Is there a quick way to delete the whole lot.

Thanks
Nicola.

In reply to Nicola Bennett

Re: Delete multiple users

by Đinh Lư Giang -
It would be better if in new Moodle version, there are check boxes in User account pages and the Admin can check some users and delete them. Thanks.
Average of ratings: Useful (1)
In reply to Đinh Lư Giang

Re: Delete multiple users

by Michael Tudor -

I'll also be needing the ability to delete multiple users at the same time, the idea of having check boxes next the users so you can select more than one at a time sounds good to me.

In reply to Michael Tudor

Re: Delete multiple users

by Jim Judges -

I like the check box suggestion - that would be good. Any news on this development wouldbe appreciated - we have 100s of student accounts we would like to delete. Any help appreciated thoughtful

In reply to Jim Judges

Re: Delete multiple users

by Art Lader -

This would, indeed, be a very useful, much needed feature. Has anyone filed a request at http://tracker.moodle.org/?

I do not see it in the list of features already requested - http://tracker.moodle.org/secure/IssueNavigator.jspa?mode=hide&requestId=10283

You can delete students from courses, of course, but this does not remove their accounts completely.

Regards,
Art

In reply to Art Lader

Re: Delete multiple users

by Chris Lamb -

I've just filed a request - if anyone would like to go and vote for it, which might move it up the priority list a bit, it's at http://tracker.moodle.org/browse/MDL-10020

Chris

Average of ratings: Useful (1)
In reply to Chris Lamb

Re: Delete multiple users

by Bug Catcher -
Hopefully they can include some of the features that I mention in this thread: http://moodle.org/mod/forum/discuss.php?d=72880
In reply to Bug Catcher

Re: Delete multiple users

by Chris Lamb -
I've just added a comment to my request pointing to your post.
In reply to Chris Lamb

Re: Delete multiple users

by Wijnhold Bolt -
In this discussion a solution is offered: http://moodle.org/mod/forum/discuss.php?d=72880
However it doe not do the job right. Out of 50 selected users to delete only two or three are deleted it seems randomly....

Wijnhold Bolt

In reply to Wijnhold Bolt

Re: Delete multiple users

by Adam VanDuyne -
I'm not working this week but I'll look at it next week, see if I can find anything wrong.
In reply to Adam VanDuyne

Re: Delete multiple users

by Wijnhold Bolt -

It looks like there are problems when different users are to be deleted who have the same (fake) email address.

To avoid this problem in future we will all fake emailaddresses which we used like fill_your_email_address@here_in replaced with unique random adresses. When a user after a certain time is not using his account we will then delete the account.

In reply to Nicola Bennett

Re: Delete multiple users

by Hitesh Patel -

Please follow these steps. Go to...

Site Administration>Users>Accounts>Bulk User Actions

Add to selection the users you want to delete from Available list to to Selected list.

Choose Delete against With selected users and press Go.

Thank you!

In reply to Clint Lalonde

Re: Delete multiple users

by Ravishankar Somasundaram -
Hi all,

If my understanding is right about the above conversations, you all looking for a way to delete multiple user accounts at same time.

I don't know why such a big thread for this question, and i wonder so many people facing same problem.


actually there is a solution.

In admin interface you can deleted multiple accounts using bulk user action.

( Users -> Accounts -> Bulk User Actions )

over there select all the users which you want to delete and then click " add to selection " button, Now you will see all the selected users appear in the selected column and select the Delete option from "With selected users" list box.

And after a confirmation there you go " Deleted multiple users at same time "

and regarding the check box suggestion which was give above , i think there is no need for that, in check box you are going to tick it and in list available presently you are going to select it using Ctrl key or Shift Key to do multiple.


Do reply me if you find this useful or message me back if i didnt address your requirements properly due to misunderstanding smile

Average of ratings: Useful (1)
In reply to Ravishankar Somasundaram

Re: Delete multiple users

by Emma Furness -

The delete multiple users is a great function, but I wish that you could choose to NOT delete people then do a bulk removal.

For example I can select anyone who has status as a student somewhere on the site and delete them, but some of our staff are students and it will delete them completely which is no good for the sites they teach on.

But if there were an option for 'is not' teacher then I could combine the search to ONLY get those persons who have no other role than that of a student.

Am I asking too much do you think?

In reply to Ravishankar Somasundaram

Re: Delete multiple users

by Neil Spurgeon -

This doesn't actually work, it removes people from Moodle but leaves them in the database which is practically useless.

I've just dropped 3500 old users from the databse - which feels like the cleanest way to do it.

In reply to Neil Spurgeon

Re: Delete multiple users

by Sara Moore -

I want users to be deleted from the database as they are removed from our Active Directory.  We are successfully using LDAP and have CRONS setup to do it but it's not working.

Does anyone have any ideas/thoughts?

Cheers

In reply to Sara Moore

Re: Delete multiple users

by Richard Klein -

Being able to delete multiple users would be great smile My understanding may be wrong, but it makes sense that the rows in the database should remain there even when the account is deleted. 

Suppose that as a teacher, I have create a course, uploaded lots of work and set it up nicely... Later on I leave the school and someone else takes over my job. Now moodle knows that my account (ID=321) entered all that stuff. If the row from the users table is deleted, the database now has 2 options - leave things as is, but this then leaves inconsistencies in the database. If they want to look up "who uploaded X" then they would never be able to tell that it was my accout. On the other hand, to avoid inconsistencies, the database could delete everything that points to my account. This is obviously not desirable as they would now lose all the work that I've done for them.

I think that any orphaned row in the users table - one that is not referenced anyware in the site - would be save to delete, but otherwise it would be a very bad idea. It seems like a lot more work than is necessary, rather just mark the "deleted" column with a 1.

Most systems work like this to help keep the data consistent.

In reply to Richard Klein

Re: Delete multiple users

by Ananquel Gómez -

Hi!!

I have a problem that I can't  solve yet. Moodle version 3.0.2

I need to delete 1500 users from my Moodle site. I don't need to conserve nothing of their activity, logs, anything. The problem is that when I try to delete them from user bulk (/admin/user/user_bulk.php) such as upload users tool  (admin/tool/uploaduser/index.php) or delete manually, one to one, occurs the error I share in file attachment.

I restarted courses in which users where matriculated before trying to delete users from the platform. Could this be the problem? Do you know how to fix it? I understand that delete rows from mdl_user table on database is not an option and it could crash de whole site, right?

Excuse me if my English is not the best, I hope you can undertand me, and I find a solution! smile

Thank you all!

Attachment error-borrar-usuario.png
In reply to Ravishankar Somasundaram

Re: Delete multiple users

by Leo Gregorc -

Ravi,

Thanks for this.  Excellent.  I am a bit embarrassed that I did not consider this before.  GOLD standard!!

In reply to Ravishankar Somasundaram

Re: Delete multiple users

by Reinaldo Lopez -

Hi

When that option selects gives the following message

"Only lowercase letters allowed

More information about this
Error"


Any way to solve it?

In reply to Ravishankar Somasundaram

Re: Delete multiple users

by Tina Smith -

I'm looking for info on this as well...TEN YEARS after this original post was posted...and still this is an issue. And I wanted to point out that the bulk user option is useless to me because it ONLY gives the student name.

I am deleting spam accounts, and I am identifying the spammers by other info on their accounts...their name alone is useless to me. So in order to use the bulk option I first would still have to create a list of all the names to delete. PAIN IN THE ASS.

It would be SO MUCH BETTER if they'd just add a friggin check box to that list of users so I can just delete in bulk on that list!!

WHY, after all this time, is this STILL not an option???  Or am I just missing something...because so far all I'm seeing is the useless (to me, in my situation) bulk user option...and then going through my list one by one and x'ing out all my spammers one.at.a.time option.  SOOOOO time consuming!!!

SIGH!!!