Skip to content

Instantly share code, notes, and snippets.

@SAFAD
Created February 24, 2022 20:57
Show Gist options
  • Save SAFAD/dfc16d4d485aa78031d47c458e7b652e to your computer and use it in GitHub Desktop.
Save SAFAD/dfc16d4d485aa78031d47c458e7b652e to your computer and use it in GitHub Desktop.
How to unlike all Facebook page at once

Unlike all facebook pages 2022

Go to: https://m.facebook.com/pages/launchpoint/liked_pages

Paste the following script into console (F12 -> console):

var unlike_all = ()=> {
	[].slice.call(document.querySelectorAll('[data-sigil="action-title"')).filter(x=>x.innerText.indexOf('Unlike') !=-1).map(x=>{x.click()});
	window.scrollTo(0,document.body.scrollHeight);
	window.setTimeout(unlike_all, 3 * 1000)
};
unlike_all();

you're done!

@tyrtles
Copy link

tyrtles commented Jun 5, 2024

This script works:

(function() {
    function unlikeAllLikedPages() {
        const actionButtons = document.querySelectorAll('[aria-label="Action options"]');
        actionButtons.forEach(button => button.click());

        setTimeout(() => {
            const unlikeButtons = Array.from(document.querySelectorAll('[role="menuitem"]')).filter(button => button.innerText.includes('Unlike'));
            unlikeButtons.forEach(button => button.click());
        }, 1000);
    }

    // Execute the function
    unlikeAllLikedPages();
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment