Your destination for complete Tech news

How to Invite all Facebook Friends to Like a Page or Event on Facebook 2017 with JS Code

1.39K 0

There was a time when you could invite all your friends all at once to like your page or invite them to any events you are organizing, but the times have changed and Facebook no more allows you to invite all your friends at once.

But there is always a way to bypass those restrictions as we will be demonstrating how to invite all your friends to like your page or invite them to your events.

Edit: Now Facebook no more allows you to invite more than 500 people per day

Steps to Invite all your friends to like your Facebook Page at once

Using Google Chrome Extension

  1. Install this Google Chrome extension from this install link.
  2. Go to your Facebook page and click on the Invite Friends
  3. Use the extension and the Extension will do all the magic
    Note: Inviting process may take several seconds so have a little bit patience

Using Javascript Code to invite all your friends

  1. Go to your Facebook Page and click on the Invite Friends link
  2. Scroll down to all the way down on the list so that all the profile of your friends loads completely
  3. Type “javascript:” into the address bar and include the following code just after that and hit Enter and you are all done.
    You can do this alternately by right clicking on the page and click on “Inspect Element” and go to the “Console” tab and paste the Javascript Code there

    var inputs = document.getElementsByClassName('_1sm');
    for(var i=0;i<inputs.length;i++) { inputs[i].click(); }

Steps to Invite People that liked your post to Like your Page on Facebook

  1. Follow the steps from 1 & 2 from above
  2. Paste the following code on the address bar like above or by going to the “Console” tab in Inspect Element
    var inputs = document.querySelectorAll('a._42ft._4jy0._4jy3._517h');
    for(var i=1; i<inputs.length;i++) {
    inputs[i].click();
    }

Steps to Invite all friends to a Facebook event at once

  1. Go to your Facebook Event page
  2. Click on the “Share”->”Invite Friends”
  3. Sroll down to all the way down on the Friends list so that all the profile of your friends loads completely
  4. Again type “javascript:” into the address bar and paste the following code just after the “javascript:”
    elms = document.getElementsByName("profileChooserItems")[0];
    var tmpElms = [];
    var tmpElmsObj = {};
    elmsClass = document.getElementsByClassName('_1pu0');
    for (i = 0; i < elmsClass.length; i++) {
    var id = elmsClass[i].getAttribute("data-reactid");
    var classActive = elmsClass[i].getElementsByClassName('_1pu2')[0];
    id = classActive.getAttribute("aria-labelledby");
    classActive.className = "_1pu2 _1pu3";
    classActive.setAttribute('aria-checked', true);
    id = id.split('-');
    id = id[0];
    tmpElmsObj[id] = 1;
    tmpElms.push(id);
    }
    document.getElementsByName('profileChooserItems')[0].value = JSON.stringify(tmpElmsObj);
    void(0);

    If you are having any problems with the code, please message us or comment down below.

Leave A Reply

Your email address will not be published.