Inviting All Friends to Facebook Events

Inviting All Friends to Facebook Events

By: Michelle Mangen
March 11, 2011

Update June 7, 2011: Sometime last week it appears the script no longer works. If someone finds another solution, or writes a new script, we would love it if you let us know.

Update March 16, 2011: Not exactly sure when Facebook rolled out the changes to their events (sometime in the last week?). The original referenced script no longer works with the newest changes. Thanks to one of the super people who commented below (Michele). He shared a new script that allows you to invite 200 at a time. His post indicates he tested in Chrome and I tested in Firefox. You can repeat the process (200 at a time). Thanks, Michele

Additional note discovered by another reader ~ if you scroll to the bottom of your friends list (in the pop-up window) before running the script in your browser it will select all friends. It may take awhile…in my tests in both Firefox and Chrome it took about 7 minutes to fully process.

Here is the new javascript: (download in .txt file)

javascript:elms=document.getElementsByName(“checkableitems[]”);for (i=0;i<elms.length;i++){if (elms[i].type=”checkbox” )elms[i].click()};

If the code above doesn’t work please download it from the .txt file link above.

My job on a day-to-day basis is all about efficiency, doing more in less time and finding nifty tips and tricks that help me and my clients. That’s why I’m excited, in a geeky way (of course) about this trick that is specific to Facebook Events.

If you’re one of those folks who regularly creates events in Facebook, you probably know what I mean. Your wrist gets all tingly and ultimately falls asleep and you find yourself bored to tears from the sheer drudgery of all the scrolling down and clicking each friend’s avatar to invite them to your stinking event. For you, this will be one of those Hallelujah! moments.

And the super HooDoo VooDoo magic trick? Well, it allows you to use a nifty Javascript command in your browser. Instead of clicking each person’s name/avatar individually in the “select guests to invite” window, it will automatically select all of your friends. Hooray!

In my first test, I used Firefox and it took about seven minutes. (Firefox actually initially said “not responding,” but I left well enough alone and sure enough, voila it worked like a charm.)

In my second test I used Chrome and it literally worked in less than 10 seconds. Here’s what you do:

  1. Create your event and save
  2. Go back to “edit event”
  3. Chose “Select Guests to Invite” button
  4. Wait for all friends to load, which may take some time
  5. Paste the command below into address bar of your browser (NOT the search bar that shows in the pop-up box that loads when you chose “select guests to invite”)

javascript:elms=document.getElementById(‘friends’).getElementsByTagName(‘li’);for(var fid in elms){if(typeof elms[fid] === ‘object’){[fid]);}}

This screenshot is from Chrome of the Javascript command in your browser URL area

Facebook Invite All Friends to Events Javascript Command

Be patient and let your browser do its thing ~ wait until all of your friends avatars are highlighted as “selected” guests. In the screenshot below, upper right corner you will see “1108” as the selected number.

Facebook Select All Friends

Once all of your friends are selected, you can enter a personal message (optional) and then just hit “Save and Close.”

Hopefully, if you’re a crazy multi-tasker like me, and creating events and inviting folks to them, you’ll enjoy this as much as I do

PS: Since I did test number two in Chrome I took my screenshots there using Awesome Screenshot browser add on that Shelly recently wrote about. I was a Jing user, but am now totally sold on Awesome Screenshot after trying it for the first time with the above screenshots. Woohoo!

  • Vinylgurlguardian

    As an events promoter, sometimes facebook lags especially if you have around 1,000 plus members to invite.  It took me sometime but this java script works with just one click.  Patience dear juggernault as they say.

  • Anonymous

    Glad it worked for you!!

  • Imanol Anguiano

    It stops working again 🙁

  • Imanol – it’s been pretty hit or miss since June 7th. Facebook changes things a lot and as of now I am not aware of a new script.

  • Djvampjd

    doesnt seem to work anymore 22nd august 2011

  • Mrawsome61

    i have chrome and wen i hit enter it just searches it



  • Not that I’m aware of…though I wish there were, it sure was handy!

  • The script hasn’t been working since early June 🙁

  • Jimmy

    it still works for me, but it takes a little bit longer i think.

  • Creatingcommunity

    09/04/2011 It worked for me today.   Used the text file version above. Used Chrome. Created a Bookmark with the url from the text file in Chrome.   Opened the Invite Friends window and then clicked the Book mark.  Ta Da.  Thanks soooooooooooooo very much!!!!!! 

  • Wow, surprised to hear that but happy to know it worked for you. Seems there has been very mixed success with it since early June.

  • Djvampjd – top of post has a note that it hasn’t been working since early June. However, for some reason, on some days it appears to work for others based on the comments they are leaving here. Not sure of the rhyme or reason as to why it’s being so sporadic.

  • Sunshinestudios

    Was working every time for me until last week..:(((  help!!

  • Sorry, don’t know what to tell you. Facebook is constantly making changes.

  • nice

    doesnt work with firefox  or chrome but with internet explorer

  • this doesnt work anymore

  • This doesnt work anymore

  • Ana – it has been working, sporadically at best, since the update mentioned at the top of the post on June 7th. 

  • Asap_bobby

    can someone freaken find one for google CHROME PLEASE I BEG U!

  • Asap_bobby

    yes totally works on chrome:  

    step 1: type in:  javascript: 

    step 2: paste: javascript:elms=document.getElementsByName(“checkableitems[]”);for (i=0;i<elms.length;i++){if (elms[i].type="checkbox" )elms[i].click()};

  • Bobby – glad to hear you found that…it doesn’t work for me.

  • OfficeSecretary

    For some reason, only the script in the .txt file works. I used Internet Explorer and it selected all my 1000+ friends within 5 minutes. THANK YOU THANK YOU THANK YOU!

    such a time saver…

  • Summer20fun

    Save this in your favorites and then click it after scrolling down to the bottom of your list of friends…worked for me in google chrome but none of these other suggestions did.

  • Summer – thanks for the tip. I’ll def try that myself the next time I do an event. 

  • Ahmadkloub

    it works .. just leave a space between javascript:(space) then the rest of the code… cheerz

  • Ahmad – love that you shared this. Thanks.

  • Jollysailor

    definatelynot working for me. i have vista…

  • JollySailor – same for me, none of the other fixes below will work and I’m also on Vista. 🙁

  • Steven

    It worked, but then gave me an error message and asked me to put in the characters in the box for security verification???

  • REALLY! it don’t work….. AT ALL

  • gianna

    it isnt working ):

  • It hasn’t been working since early June (see top of post for more detail)

  • This is for Facebook only.
    What about invite all friends from email addresses?

  • Not sure how that works, since I don’t have all of my Facebook friends’ email addresses I’ve never tried that method.

  • Ianpirro

    wrote this today works fine.

    javascript:var x= document.getElementsByClassName(“checkbox”); for (y in x){x[y].click()}

  • Ianpirro

    if you copy & paste this you may have to re-add the javascript: at the beginning some browsers remove it when pasted in address bar

  • Davi

    If you type the javascript: in the address bar it works fine. Some browser’s delete this part of the command when you paste it.

  • Davi – what browser are you using? I’m on most recent version of Firefox and it still doesn’t work for me (and the “javascript” is there)

  • Shiftnc

    It just worked when I used it in Chrome – I did have to retype the words ‘javascript’ at the beginning but other than that – good to go

  • Jon O

    retyped ‘javascript’ and no luck.  Using Firefox. Any suggestions?

  • Sorry no answer for you —- I’ve tried the suggestions offered by others in this thread but I’m not getting it to work either (I’m on newest version of FF and one suggestion in the comment thread is several versions “old”)

  • Azactive

    only works 100 then 50 at a time

  • Mmcleavy

    when I copy the script into the address bar and hit enter (in chrome) it just goes to a google search results page…what am I doing wrong?

  • Not sure as it won’t work for me either. From the comments below you’ll see some pretty mixed results since the changes Facebook made last June. Sorry 🙁

  • Ianpirro

    javascript:var x= document.getElementsByClassName(“checkbox”); for (y in x){x[y].click()}
    You will have to retype the javascript: again at the beginning because chrome and a few others get rid of it

  • This link worked today for me from the txt file. thanks