Mass Removing Facebook Friends

Written by AbiusX on . Posted in Computer, Development, English, Hacks

NOTE: the script is not functional at the moment (due to facebook API changes). I will remove this note once I make a new working version.

Update Sep 2014: 

I've created a new version of the script which works on recent Facebook. Apparently facebook allows you to easily remove single friends nowadays; so the script is extra useful for deleting bulk friends or inactive friends.

To use the new script you don't even need GreaseMonkey or TamperMonkey. Just follow these simple steps:

  1. Go here, select and copy the entire script (into the clipboard)
  2. Go to your facebook friends page using Google Chrome (or Firefox) at facebook.com/friends
  3. Use menu View->Developer->Javascript Console (Tools->Web Developer ->Web Console on Firefox)
  4. Paste the entire script here, and press enter
  5. You will see a help message started with **** FBDX *****
  6. Follow the instructions of the tool to do whatever you please! (type FBDX.help(); at any time in the console to see help again)

 

Original Post:

I have Googled around on how to mass remove facebook friends from time to time. Unfortunately facebook does not allow that, because its bad for business; but many people are looking for a hack around. Back in the day, the mobile version had a much easier friend removal process, but they've made it similar to the desktop version and very boring.

The current method of removing a friend, involves either going to his/her profile or to your list of friends, hovering over friend-status button (first request), selecting unfriend (second request), confirming it (third request), approving the removal (forth request). Each of those asynchronous operations need to be done synchronously, because the confirmation dialogs take half of the page; so assuming each one takes half a second, it takes 3 seconds to remove a friend (on a delay-free connection).

Now what if you have 4000 friends (many of which are taking dust) and you want to remove around 3000 of them? Welcome to hell. If you take up the manual approach, you're bound to drop midway, because it takes more than 4 hours and drives you nuts.

There are scripts around that usually don't work, and are mostly non-user-friendly. I decided to filter my friend list today, and when I got to it, I realized it would be much better to spend those 4 hours creating something that others can use as well, instead of doing some repetitive work (which is literal hell for developers and hackers). So I made this script:

http://userscripts.org/scripts/show/162656

Update (May 2014) : userscripts is down (or dead?) so grab the script from here : script.js

Update (Sep 2014): there's a userscripts mirror site available, I've updated the link above to work.

It's a robust script run inside GreaseMonkey (for Firefox) or TamperMonkey (for Chrome), which are basically environments to run hack scripts for different websites. The script does not work on non-recent browsers and on Internet Explorer. I suggest using fresh Google Chrome, as the script is CPU intensive and Google Chrome is the best for rapid Javascript evaluation.

After installing the script in your grease environment, and enabling it (you should disable it after you're done, as it messes with facebook dialogs), head to your friends edit page (https://facebook.com/friends/edit), and you should see Fast Remove buttons next to every active friend's picture. The edit friends page of facebook only displays a handfull of friends, but scrolling to the bottom adds another handfull to the page. You can put some adequately heavy object on your Page Down keyboard button, and leave it be until all friends are listed.

Now the first thing to do, is delete all your inactive friends (people who have disabled their facebook accounts). 90% of them never get back to facebook, and those who do, can go ahead and add you again. From the TamperMonkey (or equivalent) menu, click on FacebookDeleteX - Remove Inactive  submenu. A confirmation box will appear, saying how many inactive friends found, and if you're sure to delete them all. After clicking yes, all deletions are queued and another dialog gives you some information.

At this step, you should wait (or you can start doing the fast removal - next step). Because each removal requires 4 steps (requests to be made by the script), each one of them takes some time to accomplish. Closing the page will cancel them. If you're removing 1000 inactive friends, you should wait at least 1000x3 seconds (or an hour). You can always check your number of friends before starting this, and check it again in another window and see when it reaches the desired amount (total_number - inactive_number), then close this window.

The final step, is manual fast-removal of your friends. In this step, you have to click on each Fast Remove button, next to people who you don't want anymore. Don't spend too much time deciding if something belongs or not, just press Fast Remove. Later you can add them again easily.

Every time you press Fast Remove, it takes a second or so for the requests to be handled and for the button to disappear (if you've a lot of requests queued from previous step, it can take a lot. Just click them once and proceed to the next one, or open another window and do this there) . Right after that, a dialog box pops up informing you that the friend was removed. This script will automatically close these dialogs once every second.

If anything seemed not to work with the script, don't hesitate to contact me for a fix. Happy facebooking.

P.S this script takes 60% CPU on a MacBook Pro Retina (which is equivalent of 4 regular PCs).

Update (May 2014): A lot has changed on facebook since I created this. If anything is not working, please comment here and I'll fix it!

Tags: , , , , , , , , , , , , , ,

Trackback from your site.

Comments (70)

  • june d

    |

    Thank you so much this one finally works. was changing accounts & wanted to delete all friends b4 shutting account down <3

    Reply

  • Salar

    |

    bro i know i have +1000 inactive friend ~ but whene click on delete inactive friend,thats say you have 0, why ?

    Reply

    • em

      |

      I’m having the exact same problem.

      Reply

    • AbiusX

      |

      I do, email me for that.

      Reply

      • alex

        |

        delate multiple facebook friends script is not working. help please! thanks in advance! mahalos, alex

        Reply

      • David

        |

        Hi, if you still have this script, i have over 2000 ppl to remove.
        regards, David

        Reply

      • David

        |

        mail the script plz it is very urget my mail id is

        Reply

        • AbiusX

          |

          I have put the link on the post. Please download and let me know whether it works with the current facebook interface or not, so that I can update accordingly.

          Reply

          • makr

            |

            can you email me the script i don’t see in post like you said.

            Reply

          • AbiusX

            |

            I’m sorry but I can’t. You should be able to find two copies of the script on this post! What is the problem?

            Reply

        • AbiusX

          |

          Thats no error and expected. Its just to make sure that the script is working, and also let me know how many people downloaded it.

          Reply

  • Dileep Raveendran

    |

    Dear AbiusX

    Can you send me the script to my id, the given id is not working

    Reply

  • John

    |

    Can I get a copy of this, please?

    Reply

  • Chad

    |

    Please provide link to for the script for mass deleting via GreaseMonkey. Userscripts.org is down. Thanks!

    -Chad

    Reply

  • LSW

    |

    I’d like the script too. Thanks.

    Reply

  • Card

    |

    Script is not working

    Reply

    • AbiusX

      |

      Care to elaborate?

      Reply

      • Him

        |

        Dead link

        Reply

  • Amanda

    |

    It doesn’t seem like the Inactive Friends removal is working. It keeps saying I have 0 inactives, but I can see that there are quite a few it should be picking up on. Any tips please?

    Reply

  • Marc

    |

    hey script is not working, can you provide me the link?

    Reply

  • prince

    |

    script is not working

    Reply

  • jam

    |

    script doesn’t work.. nothing happens when i click ‘remove inactives’.. how can i fix it? thanks! :)

    Reply

  • Triggerself

    |

    Dear AbiusX,
    Inactive friend removal function does’t work, please help. Thank yoi

    Reply

  • abhinav

    |

    Thanx sir, its working fine

    Reply

  • Ismet

    |

    Does anyone have this script to mail it to me …i really need it
    E mail:ismet.cisic@gmail.com

    Reply

  • chan

    |

    inactive account says 0. i have many inactive friends in my friendlist. please fix it. thank you

    Reply

  • Franco

    |

    FacebookDeleteX – Remove Inactive is not working :/ help me plz <3

    Reply

  • tommy

    |

    Hello, i really need to figure out how to use this, i have google chrome and installed tampermonkey and looks like the script is installed correctly, is there anyway you can make a quick tutorial on what to do as i might still be confused???

    Reply

  • Blaze

    |

    Dear AbiusX. I want to learn to script on Facebook environment, just like what you did. But the problem is I can’t find any tutorials to work around. Maybe can you point me a tutorial so I can have a fresh start? Thanks a lot.

    Reply

  • genu

    |

    hi it’s very hard to load all my friends by clicking the page down button.. please make an auto inactive friend deleter which delete all the accounts which is inactive from last 1 year.

    Reply

  • jkister

    |

    FF 30.0 latest GM and script.js from the mirror. ‘Remove Inactives’ always shows 0 even though i can see them on the page.

    Thanks for the awesome code!

    Reply

  • TobbieFox

    |

    I don’t see a contact email here so I’m asking for the same greasemonkey script.

    Thanks!

    Reply

  • PJ

    |

    i see that you provided a link to the script “Update (May 2014) : userscripts is down (or dead?) so grab the script from here : script.js” but once you install the tampermonkey extension for chrome how exactly do you install the script? Very confused about the steps involved. maybe screenshots would help? I appreciate your guidance.

    Reply

  • Yarmin

    |

    Hey do you have the link for the new script? My E-Mail is cleancutmhc@gmail.com. What is your e-mail? Desperately need to purge my FB Friends List.

    – Yarmin

    Reply

  • pete

    |

    Can I please have the script? Userscripts is down. Thank you.

    Reply

  • Tam

    |

    Hi, after installing the script (greasemonkey) I do not see the “fast remove” button at all. Is there something I did wrong? I’m an absolute beginner.

    Reply

  • Taina

    |

    Awesome!!!! One that finally works!

    Reply

  • AbiusX

    |

    Can someone update me on whether this works or not? Please specify your browser and facebook interface (new or old) and also whether fast remove doesnt appear or inactive removal doesn’t work. I can update the script then.

    Reply

  • rendy tatta

    |

    dear abiusX
    the fast button is working but to remove inactive person in one click is not working can you fix the bug please.
    thanks for the script it help me

    Reply

    • AbiusX

      |

      I would need an HTML copy of your friends page to figure out the problem with the JS selector. Please send me an HTML copy (File -> Save As) of your friends list. It doesn’t need to be all of them, as long as there are 2+ inactives in there it would do.

      Reply

  • Jason

    |

    AbiusX can you help when trying to remove deleted facebook inactive people when I run the script and click on remove Inactive friends it says that I have 0 inactive friends. now what am i possibly doing wrong

    Reply

    • AbiusX

      |

      As mentioned in the previous comment, I’d need a static copy of your friends list page to reproduce the problem and solve it. Please email me a copy.

      Reply

  • Ryan

    |

    Hi there… Thank you SO much for this script. Loving the fast removal tool. How ever when I click delete inactive it says I have 0. Please advise…

    Reply

    • AbiusX

      |

      Which script did you use? If the original one doesn’t work, use the new one.

      Reply

  • Noel

    |

    Thanks a lot. It saved me!

    Reply

  • Boris

    |

    I’ve downloaded latest script, and tried, but it says 0 inactive friends, and I have a lot of them, please help.

    Reply

    • AbiusX

      |

      Take me through the exact steps you took so that I can help you more.

      Reply

    • Facebook user with a lot of friends

      |

      I have the same problem.
      I guess by “inactive” you mean people that have disabled their accounts, right?
      There are like 3-4 people on the first page of my facebook ‘friends’
      I click on ‘Remove Inactivities’ and a a menu pops up that says “0 inactive friends”

      Reply

      • AbiusX

        |

        Yes, inactives are those that have disabled their account. Use the new script, its been confirmed working by many.

        Reply

  • Facebook user with a lot of friends

    |

    This actually works, I thought there was no chance! Thank you.

    Reply

  • chris

    |

    hi does this script still work?
    I try to click the new updated one for Sept 2014 it says Go ‘here’ and when I click on it my laptop says to me its been removed. pls help many thnaks

    Reply

    • AbiusX

      |

      Yes it works. People have confirmed it. Please let me know what you’re exactly doing, and where you are stuck!

      Reply

  • Mathis

    |

    Hello, when i try “FBDX.removeFromList(number);”

    I get this message..

    Uncaught ReferenceError: number is not defined
    at :2:21
    at Object.InjectedScript._evaluateOn (:895:140)
    at Object.InjectedScript._evaluateAndWrap (:828:34)
    at Object.InjectedScript.evaluate (:694:21)

    Thanks,

    Reply

    • AbiusX

      |

      Please let me know the steps you take so that I can reproduce the problem. Browser and version helps too.

      Reply

        • AbiusX

          |

          It says “please wait while I retrieve the list of all your friends”. You should wait for it to finish, so that you don’t get “Error: Init first”.

          Reply

          • Mathis

            |

            Yes, but the scroll is moving just once..

            Reply

          • AbiusX

            |

            Then there should be another problem. Please email me directly at me at my website

            Reply

          • Mathis

            |

            Done.

            Reply

          • Adrian Haywood

            |

            I am having the same problem. I am trying to delete inactive friends and I’m getting a message saying wait to retrieve list of all your friends but it never finishes obtaining this list. It just sits there and I now only have less than 1,000 friends. I used both chrome and firefox. They both gave me the exact same issue.

            Reply

  • Mo

    |

    Hi, seem to be stuck. How long should it take to initialise?

    I run FBDX.init(); then it says ” 873 so far …” (i was expecting 970).

    Then if I try to run any of the other functions e.g. FBDX.addButtons() I get an error message “Error: init first”

    I’m using Chrome – Version 45.0.2454.85 (64-bit)

    On iMac OS X 10.10.5

    Reply

    • Adrian Haywood

      |

      same with me

      Reply

  • Jamie

    |

    ” From the TamperMonkey (or equivalent) menu, click on FacebookDeleteX – Remove Inactive submenu.” I don’t see a submenu. All I can do is either activate or deactivate FacebookDeletesX.

    Reply

  • FIREFOX

    |

    Hello, when i try “FBDX.removeFromList(number);”

    I get this message..

    Uncaught ReferenceError: number is not defined
    at :2:21
    at Object.InjectedScript._evaluateOn (:895:140)
    at Object.InjectedScript._evaluateAndWrap (:828:34)
    at Object.InjectedScript.evaluate (:694:21)

    Help me..

    Reply

Leave a comment