How to invite all your Facebook friends to an event at once (code has changed)


In the last few days, Facebook has changed the “invite your friends” functionality, which powers suggestions and invitations to events, groups, pages, etc.

The result is that old Javascript codes that allowed you to invite ALL your Facebook friends to an event in a snap (such as this) are now broken.

To select all your new friends in the new interface you can use this code, tested under Safari 5.0.4, Chrome 10 and Firefox 4 (should work also under IE).
UPDATE: There are many reports of it working on newer versions in the comments below.

javascript:var x=document.getElementsByTagName("input");for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected');

In order to use this code, copy and paste it in the address bar of your browser after you have opened the “invite your friends” dialog and AFTER YOU HAVE SCROLLED DOWN THE LIST.

Important note: as said, you HAVE to scroll down your friends list in order to invite all your friends: in fact the new interface only loads few friends via AJAX at a given time.

Facebook should definitely be a little more open regarding MY data, loaded on their systems… and this script opens it just a bit more.

DISCLAIMER: I DO NOT ASSUME ANY RESPONSIBILITY WHATSOEVER FOR THE USAGE OF THIS CODE; IF YOU GET BANNED BY FACEBOOK, OR ANYTHING ELSE, YOU WILL BE CLAIMED THE SOLE RESPONSIBLE FOR SUCH ACTIONS.

  1. #1 by Kamil Urban on 19/08/2011 - 14:41

    In my case it’s the same. I’ve used it many times and it worked perfectly. Thanks, cause it saved my allot of clicking.

    But today nothing happens when I press enter after pasting that URL.
    Can someone please provide a working code?

  2. #2 by nightology on 20/08/2011 - 00:19

    Same here… been using it for a while and has saved me sooo much time…

    but today its not working for me…

  3. #3 by Annie Schempp on 20/08/2011 - 17:48

    This doesn’t work for me in IE, Firefox or Chrome! Please help!

  4. #4 by fabs on 20/08/2011 - 19:40

    It´s been working since the last days. Seems like FB has chanced something. Now i just do nothing at all. I press enter, and Nothing. In IE and Firefox ( remember it use to work just a week before)
    Can you help me?

  5. #5 by John on 20/08/2011 - 21:16

    It keeps giving me this error: Please narrow your invite list to friends who are most likely to be interested in this event. Anyone find how to get around it? I filtered people by city and it worked once. but now nothing.

  6. #6 by bruce on 24/08/2011 - 18:00

    This code does not work i have tried it many times i believe facebook has dectected it

  7. #7 by Chris on 06/09/2011 - 02:56

    You are awesome. The scroll down to the end part was key!!!! Thanks for walking me through ALL of the steps!!

  8. #8 by Scotty on 07/09/2011 - 20:32

    Tried this last week and it worked fine.Its not working now. I’m using the latest firefox

  9. #9 by Mutters on 12/09/2011 - 00:26

    Yes I agree with Scotty. I used Marco’s code on 15th August and it worked like a dream but it’s not workng now ;-S ‘hate facebook’!

  10. #10 by Robert on 12/09/2011 - 22:57

    HELP! When i put the code into the url box it doesnt select all, it does a search! HOW do i fix this??

  11. #11 by Shane Messick on 14/09/2011 - 21:31

    I created an event for the release of our new channel http://www.youtube.com/7DailyGays and this code saved me at least an hour! Thank you so much!

  12. #12 by GuruKarta on 20/09/2011 - 00:44

    Thanks for the code it works excellent.

  13. #13 by Chelsa on 29/09/2011 - 00:20

    This did not work for me. I’m not sure if I’m doing it wrong or what. I scrolled through my friends and pasted the link on the bar and it takes me to google?

  14. #14 by Chelsa on 29/09/2011 - 00:20

    This did not work for me. I’m not sure if I’m doing it wrong or what. I scrolled through my friends and pasted the link on the bar and it takes me to google?

  15. #15 by david on 04/10/2011 - 00:42

    I know fb keeps changing things so you’ll spend advertising dollars with them. Do you have a new code that works with the changes?

  16. #16 by Jon on 04/10/2011 - 07:23

    This code DOES still work, as do a few others! This is important though – for some reason, when you copy then paste the code into the URL box, the “javascript:” gets lost.

    So, make your event, click the invite button, scroll down through your friends to make sure they all appear and get selected, then paste the code into the URL box, then go to the beginning and just add “javascript:”

    Works in Chrome 14 on Mac, and probably others.

    Thanks!

  17. #17 by Rob on 05/10/2011 - 21:27

    Thanks! It still works. You do still have to add: javascript: at the beginning of the code.

  18. #18 by Kim on 06/10/2011 - 00:59

    Thank you! It worked like a charm. All the my friends were selected after submitting the code. However, the new Facebook blocked it and told me to “narrow” my invite list and de-selected my friends! Ugh!!!!

  19. #19 by Cory on 18/10/2011 - 00:18

    I have followed the directions, and added javascript: again at the beginning.

    But when I press enter it is sending me to google??

    I have the curser placed in the javascript.

    Suggestions?
    Thanks!

  20. #20 by Brian allison on 19/10/2011 - 16:29

    I have tried IE Chrome Firefox and Safari. If I right click on the invite friends window, there is no option to open frame in a new window. I cannot get the code to work. If I put it in the address bar of the main facebook window and hit enter it does nothing.

  21. #21 by Eleonora on 19/10/2011 - 22:38

    Fantastic, thank you!
    I had tried another code but was not so efficient. At this stage it looks like out of 5000, 3500 invitation were sent . I will give it a few hours to see if the numbers change or might try it again.

    Grazie mille,

    Eleonora.

  22. #22 by Cynthia on 20/10/2011 - 22:17

    Once all my friends are selected with the code and click send invitations, I get an error message from FB to limit my invitations only to the people susceptible to be interested in my event? Any way to go around this? Thanks

  23. #23 by marco monti on 26/10/2011 - 15:50

    Hello,
    Thanks for allow me to save a lot of time!!!
    Based on my experience this code works properly in UBUNTU with chrome and firefox.
    If I use it in windows/chrome it goes to google.

    Unfortunately I think facebook will change the rules very soon… and I Hope you’ll save me one more time!

    Grazie… è un piacere sapere che sei italiano!

  24. #24 by Monny on 04/11/2011 - 16:23

    GRAZIEEEEEEEEEEeeeeeeeeeeeeeeeeeeeee!!! viva l’Italia! :)

  25. #25 by eli on 06/11/2011 - 18:49

    /

(will not be published)