Skip to content

Instantly share code, notes, and snippets.

Created March 2, 2012 23:55
Show Gist options
  • Save adriaanm/1962608 to your computer and use it in GitHub Desktop.
Save adriaanm/1962608 to your computer and use it in GitHub Desktop.
delete all members of a fb group -- c'mon facebook, how hard can it be?
// first go to
// then paste this in the javascript console
deleteAll = [];
deleteAll.elms = [];
deleteAll.canClick = function (el) {
return (typeof el != 'undefined') && (typeof != 'undefined');
deleteAll.load = function() {
deleteAll.elms = document.getElementsByClassName("mhm auxiliaryButton closeButton uiCloseButton");
if (deleteAll.elms.length < 5 ) {
setTimeout(deleteAll.getMore, 1000);
} else {
setTimeout(deleteAll.go, 2000);
deleteAll.getMore = function() {
more = document.getElementsByClassName("pam uiBoxLightblue uiMorePagerPrimary");
if (typeof more != 'undefined' && deleteAll.canClick(more[0])) {
setTimeout(deleteAll.load, 2000);
} else {
setTimeout(deleteAll.load, 100);
deleteAll.go = function() {
try {
} catch(e) {
setTimeout(deleteAll.load, 1000);
} finally {
setTimeout(deleteAll.load, 500000);
deleteAll.doClick = function(i) {
setTimeout(function(){deleteAll.confirm(i + 1)}, 750);
deleteAll.confirm = function (i) {
remove_but = document.getElementsByName("confirm")[0];
if (i < deleteAll.elms.length - 5 && deleteAll.canClick(remove_but) && remove_but.value == "Confirm") {;
setTimeout(function(){deleteAll.doClick(i)}, 500);
} else {
setTimeout(deleteAll.getMore, 2000);
// deleteAll.fullRestart = function() {
// membersLink = document.getElementsByClassName("groupsCleanLink groupsCleanLinksSelected");
// if (typeof membersLink != 'undefined' && deleteAll.canClick(membersLink[0])) { membersLink[0].click(); }
// setTimeout(deleteAll.go, 5000);
// }
Copy link


This isn't working with the new Facebook UI. Tried it today and couldn't get it to delete people from a group. Any chance you will be working on it any time soon ? The element that I can see in your script that might have chanced is there is no longer and X next to a members name.

Copy link

I need this code in new version of Facebook groups please

Copy link

This didn't appear to work (tried it in Chrome). Any plans to update the code?

Copy link

i got undefined error :-)

Copy link

babrath commented Jun 9, 2013

I did a little updating so the code worked for me, I'm not sure how to directly contribute so I forked the project ( Hope this helps people and kudos to adriaanm :-)

Copy link

pazu88 commented Jul 3, 2013

Hi Barbrath,

PS: The new script did work!!!! I'm so excited!

I signed up to this website because I really wanted to let you know, thank you SOOOOO much!

I have an obsolete group with 1645 members! I can't imagine how much time I would to spend to remove all members one by one!

Copy link

Greaaaaaat babrath!
The script is well functionning. you are the best !
thank you very well

Copy link

dahlo commented Jan 10, 2014

You are doing the Lord's work, son :)

Copy link

Please guys someone help me here! this script dont work and im freaking out! i really need to delete the group i made by mistake!
anyone ? ? ?

Copy link

I created a script that works with the new facebook layout:
Some pieces of the code were copied from this gist.

Copy link

Hi there.
Here is another short working gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment