Unlike all pages on facebook in 2 minutes

I was finding a way on how to unlike all the pages on Facebook at one go. After trying some different things out in console and looking at some chrome extensions, I figure out with just some commands you can unlike all the pages at one go. Here’s how to do it.

Firstly go to Likes section in your profile. Here’s the snapshot help:

Click the likes section

Click the Likes link. And you will be redirected to the the likes page, which might look something like the screenshot above(I hope you can figure out with the partial view).

Then right click on your page anywhere and click inspect link in the menu. It should open a section beneath or on the sides on your browser.

Developers tool

Something like above. Click console in that and you should find a big warning saying — “STOP” and some shit. Ignore that.(Trust me! :D)

Now write this commands as listed below:

// Get hold of all 'Liked' Buttons
var buttons = document.getElementsByClassName('PageLikedButton');
Screenshot of console with code

Hit enter. And then write this command:

// trigger click on all 'Liked' Buttons, to get unlike popovers
for(let button of buttons){button.click();};
Another code in console

This may freeze your screen for sometime. But don’t worry, hold on and don’t try to refresh the page. The reason is, it is triggering click event on all the Liked Buttons on the page. If you want to unlike all the page, scroll to the most bottom part of the page — the part where you couldn’t scroll down more. This is to bring all the Buttons on the page view. The buttons who are in page view will only get that click event as other pages are not loaded into page yet as you haven’t scrolled down. Those only loads as soon as you start scrolling down. In case you just wanna give it a shot to try, you don’t have to scroll down to the most bottom part. Just load the likes page and run the commands.

Now time to trigger click on all those unlike popovers which would have appeared after running the above commands. So to unlike all of them at once:

// Get hold of all the unlike links
var unlikes = document.getElementsByClassName('itemLabel');
// trigger click on all unlike popovers
for(let unlike of unlikes){unlike.click();}
Final commands

So we are triggering click on all the unlike links that are appearing at once. And this should unlike all the pages that are present on view port.

WARNING: This will unlike all the pages that are present on the page at that time.

But hey, we can always undo the things, can’t we??!! Yes we can.

Just run the first two commands again. And that will like all your pages at one shot.

var buttons = document.getElementsByClassName('PageLikedButton');
for(let button of buttons){button.click();};

Bingo! Yes, the pages are liked back again! Give it a shot! :D