Blog > Facebook > Can You Accept Facebook Friend Requests Automatically?

Can You Accept Facebook Friend Requests Automatically?

James Parsons • Updated on February 11, 2023
Written by ContentPowered.com

Can-You-Accept-Facebook-Friend-Requests-Automatically

For most people, accepting Facebook friend requests is not much of a burden. Requests trickle into your inbox from time to time, you open the Facebook notifications page, press accept, and move on. Some people, however, may get many requests each day, so many that it becomes a real problem to deal with all of them in a timely manner.

For example, let’s say you’re doing an internet promotion, and it really starts to take off. Accepting hundreds of requests per day could take up a lot of time. Another example would be someone coordinating a large event. If there was a way of quickly accepting all these requests, it could save you a considerable amount of time.

Unfortunately, Facebook does not provide any tools or setting to automatically accept friend requests, however with a little work, it is possible to build your own solution. Let’s see how.

The Javascript way

The most common way to accept multiple requests is by using Javascript; here’s an example.

Go to http://www.facebook.com/friends/edit/?sk=requests. This will bring up all of your outstanding friend requests.

  • Copy and paste the javascript below into your browsers address bar:

javascript:for( i = 1;i<document.getElementsByName(“actions[accept]”).length;i++){document.getElementsByName(“actions[accept]”)[i].click();}void(0);

  • Press enter, and all of your outstanding friend requests will be accepted.

Note that some browsers, notably Apple’s Safari, IOS, Android, BlackBerry, and some versions of Google Chrome will automatically strip the “javascript:” off the beginning of the code above, even if you directly paste it into the address bar. If this happens, just move the cursor to the beginning of the address bar and retype the “javascript:” part of the script.

So how does this work? The line of text you enter in the address bar is in a programming language known as Javascript. This language is built into all modern browsers, and is used to automate tasks your browser performs when you use a web page, such as controlling animation, validating inputs, and taking action when buttons are pressed or an item is selected. When you enter this line, the script runs on the current web page, building a list of all of the accept buttons on the current webpage. It then loops through all of the buttons, simulating pressing the button for each of the requests.

Rejecting Requests

Rejecting-Requests

Some people have the opposite problem: unwanted friend requests that must be rejected en masse. An example may be someone who suddenly becomes well-known, and has hundreds or thousands of strangers trying to friend them. Fortunately, the same technique, with slightly different code, can be used to reject all incoming friend requests:

javascript:for( i = 1;i<document.getElementsByName(“actions[hide]”).length;i++){document.getElementsByName(“actions[hide]”)[i].click();}void(0);

  • All of your outstanding friend requests will be rejected.

Going Further

While this technique is fairly easy to use, it could get painful if you had to do it manually multiple times per day. For users that need to use these scripts frequently, there are several ways to automate the process.

Browser Extensions

For FireFox, the Facetweak extension provides a one-click implementation of the above process, plus other handy Facebook-specific tools. No extensions to automatically accept or reject friend requests currently exist for other browsers, but keep looking, since new extensions are added all the time.

Text expansion

If your preferred browser doesn’t have an extension available, the next easier way to automate the process is to use a text expansion or system macro software. Text expansion utilities record strings of text, such as the Facebook address and javascript program above, then automatically type them in for you when an assigned key combination is pressed. Macro programs go further, allowing you to open programs and perform other system actions. Either can be used to record your actions while you accept or reject friend requests, then allow you to play these recordings back to the computer when you need to repeat the action.

On the mac, TextExpander is a popular text expansion utility, while Keyboard Maestro is one example of a macro utility. On Windows, try PhraseExpress for text expansion and AutoHotkey for macros.

After recording the text, just press the hotkey you assigned to it to go to the correct web page, then press another hotkey to enter the JavaScript to accept the requests.

Scripts

script

For the more advanced users, small programs written in PHP, JavaScript, or other scripting languages can be used to automate this process. Using this approach would not only allow for automation of friend request acceptance, but also allow you to set up scripts that run automatically at a preset interval, or perform more complex processing, such as setting aside some requests for your personal review. For ideas on how you could construct your own scripts, see sites such as this userscripts.org example or another userscript.org example for sample scripts to get you started.

If you would like a more powerful way to control Facebook, you can also develop code that connects directly to the service’s Application Program Interface (API). This method will allow you the maximum amount of control, not only for accepting friend requests, but for other tasks.

Comments

  1. Darren M.

    says:

    Now Facebook needs something like this but with a spam filter to weed out all the low quality accounts. I know I’d use it

  2. mark

    says:

    BUT FACEBOOK bans acconts that accept to many friends at once, does this get around it?

Leave a Reply