Delete multiple Facebook friend requests using JavaScript

A few hours back I had opened my Facebook account and surprisingly got plenty of friend requests then I started to delete one by one by clicking the ‘Delete Request’ button then I suddenly got an Idea to write a JavaScript to do this process on behalf of me.

Then I opened the browser console and made a small scribble and all request had been removed in a second. Voila !!!

If you want to do this please click the friend requests icon on the top bar of the Facebook page, then click ‘view all’ button then a new page will open up with list of all friend requests.

Friend Requests Facebook

On the page press F12 button, developer tools will open on the bottom of the current window, now select console tab on the developer tools.

Developer tools
Finally copy and paste the following script on the console window and hit enter. Congratulations, Now all the visible requests have been deleted.

visibleFrndReqBtns = document.querySelectorAll('button[type="submit"]');
visibleFrndReqBtnsCount = visibleFrndReqBtns.length;
for(i=0; i<visibleFrndReqBtnsCount; i++){
	if(visibleFrndReqBtns[i].innerText == "Delete Request"){
		visibleFrndReqBtns[i].click();
    }
}

Caution : This code may behave inappropriately, please try at your own risk, author of this article cannot take any responsible for data loss on using this code snippet.