Bulk Remove Members from a Group

Hi there,

I’m wondering if there’s a way to Bulk remove members from a Group.

I need to remove all the members - and then re-add only a select few.

I don’t want to delete the entire group - because I have some custom integrations setup with my Wordpress site.

Thanks for any advice/support!

You can have a look at Administrative Bulk Operations for some ideas.

Something like

 GroupUser.where(group_id: 5).destroy_all

Might do it, or it might empty your bank account.

2 Likes