Skip to content

Instantly share code, notes, and snippets.

@aelk00
Last active March 1, 2024 00:58
Show Gist options
  • Save aelk00/5a28f88e928db8fcd5c88d44ff65a4e0 to your computer and use it in GitHub Desktop.
Save aelk00/5a28f88e928db8fcd5c88d44ff65a4e0 to your computer and use it in GitHub Desktop.
Remove all your facebook likes
@zampemo
Copy link

zampemo commented Dec 15, 2020

Like @nchlsschndr says, I'm still getting EVERYTHING back as I refresh the page........... FB is so trash you can't remove posts, likes and so on!
Any chance to have this working properly? I've used the script translated in Italian as I needed that in my case. Thanks.

@IrakliK
Copy link

IrakliK commented Dec 17, 2020

@zampemo try re-running the script again ?

@nischolas
Copy link

@IrakliK Doesn’t work, I ran it three times.

@Zintom
Copy link

Zintom commented Jan 9, 2021

The original posted code doesn't appear to work at the moment.

I've tweaked it and have found that generally this works quite well:

setInterval(() => {
  for (const Button of document.querySelectorAll('div[aria-label="Action options"]')) {
    Button.click()
    document.querySelector('div[role="menuitem"]').click()
  }
}, 1000)

What this code does:
Every 1 second, it loops through every 'Action options' button on the page which is the ellipses button "...", it then queries the remove button and clicks it.

You can also change the interval to every 100ms which is pretty rapid and still works fine.

The old code seems to accidentally click the "forward" button leaving it eternally broken.

I hope this helps, and many thanks to @2xa31k for posting the initial code! 👍

@aelk00
Copy link
Author

aelk00 commented Jan 10, 2021

@Zintom Thank you I update the code .

@nischolas
Copy link

nischolas commented Jan 16, 2021

Just an update for category_key=LIKEDINTERESTS eg. liked pages and interests instead of posts. It just doesn't work. Even if I manually click the three dots and then 'Don't like anymore' (translated from german – could vary). After a page refresh everything's still there. So there's that. Can someone confirm this? Adblock was disabled just in case.

I also tried this … uh … more brutal and error prone approach. Buttons were clicked, list emptied pretty quickly. But after a refresh everything's still there. This and the updated script still work for category_key=LIKEDPOSTS though.

setInterval(() => {
    document.querySelector('div[aria-label="Weitere Optionen"]').click()
    document.querySelector('div[role="menuitem"]').click()
}, 100)

@Zintom
Copy link

Zintom commented Jan 16, 2021

@nchlsschndr From looking at the page it looks like it should still work, none of the variable names have changed; I know that there's some kind of rate limit on Facebook's end, maybe you're clicking too fast? Or maybe your browser is caching the items and they're actually gone? Idk but with my code posted above at 250ms per click it took around 45 mins to eliminate my entire Facebook like history (back to 2011).

Also, unless you're following literally thousands of pages, you should be able to do it manually in less than 10 minutes.

@nischolas
Copy link

nischolas commented Jan 16, 2021

@Zintom I know it should work. What filter exactly do you mean with

Facebook like history

?
Please note that I'm talking about category_key=LIKEDINTERESTS, not LIKEDPOSTS (that works). Cache was cleared, even tried on another browser with manual clicking. Seems like FB doesn't want you to unsubscribe from multiple pages in a too convenient way.

@Mywk
Copy link

Mywk commented Feb 11, 2022

To use in the Activity History:

setInterval(() => {
    document.querySelector('div[aria-label="Action options"]').click()
    document.querySelector('div[role="menuitem"]').click()
    document.querySelector('div[aria-label="Delete"]').click()
}, 400)

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