Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove all your facebook likes
@pr1ntr

This comment has been minimized.

Copy link

@pr1ntr pr1ntr commented Dec 4, 2020

def hits API limit. but i'll be back facebook, you little bitch

@arbitrarily

This comment has been minimized.

Copy link

@arbitrarily arbitrarily commented Dec 4, 2020

works like a charm; kudos 👍

@sdsdfhkje4

This comment has been minimized.

Copy link

@sdsdfhkje4 sdsdfhkje4 commented Dec 4, 2020

10mins and it hit API limit in case someone's wondering

@2xa31k

This comment has been minimized.

Copy link
Owner Author

@2xa31k 2xa31k commented Dec 4, 2020

10mins and it hit API limit in case someone's wondering
@sdsdfhkje4 you can use filter to delete month by month and then restart if you hit API limit

@GlThibault

This comment has been minimized.

Copy link

@GlThibault GlThibault commented Dec 4, 2020

Perfect, aria-label="Action options" needs to be changed if your Facebook isn't in English.

@froh42

This comment has been minimized.

Copy link

@froh42 froh42 commented Dec 4, 2020

For Facebook in German:

setInterval(() => {
  for (const Button of document.querySelectorAll('div[aria-label="Weitere Optionen"]')) {
    Button.click()
for (const remove of document.querySelectorAll('div[role="menuitem"]')) {
    remove.click()      
  }
  }
}, 1000)
@Stell0

This comment has been minimized.

Copy link

@Stell0 Stell0 commented Dec 4, 2020

And for Italian:

setInterval(() => {
  for (const Button of document.querySelectorAll('div[aria-label="Opzioni di azione"]')) {
    Button.click()
for (const remove of document.querySelectorAll('div[role="menuitem"]')) {
    remove.click()      
  }
  }
}, 1000)
@tudorfil9

This comment has been minimized.

Copy link

@tudorfil9 tudorfil9 commented Dec 4, 2020

def hits API limit. but i'll be back facebook, you little bitch

:))

@arvedinho

This comment has been minimized.

Copy link

@arvedinho arvedinho commented Dec 4, 2020

For Facebook in German:

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

Hey danke! Funktioniert wunderbar.

@nchlsschndr

This comment has been minimized.

Copy link

@nchlsschndr nchlsschndr commented Dec 4, 2020

Thank you for this! I tried this (German version) with filter category_key=LIKEDINTERESTS trying to 'reset' my timeline. The buttons were clicked, the list emptied pretty quickly object by object but after a refresh everything was still there.

I don't think the API limit is the cause because my liked pages are maybe in the hundreds 493, not tens of thousands like all liked posts.

@mylesholman

This comment has been minimized.

Copy link

@mylesholman mylesholman commented Dec 4, 2020

Like a charm. Thanks!

@2xa31k

This comment has been minimized.

Copy link
Owner Author

@2xa31k 2xa31k commented Dec 4, 2020

Thank you for this! I tried this (German version) with filter category_key=LIKEDINTERESTS trying to 'reset' my timeline. The buttons were clicked, the list emptied pretty quickly object by object but after a refresh everything was still there.
@nchlsschndr I didn't try it in other things.

@akdenizk

This comment has been minimized.

Copy link

@akdenizk akdenizk commented Dec 4, 2020

And for Facebook in Turkish:
setInterval(() => { for (const Button of document.querySelectorAll('a[aria-label="Düzenle"]')) { Button.click() for (const remove of document.querySelectorAll('a[role="menuitem"]')) { remove.click() } } }, 1000)

@GreenAstronaut

This comment has been minimized.

Copy link

@GreenAstronaut GreenAstronaut commented Dec 4, 2020

For frenchies :

setInterval(() => {
  for (const Button of document.querySelectorAll('div[aria-label="Options d’action"]')) {
    Button.click()
for (const remove of document.querySelectorAll('div[role="menuitem"]')) {
    remove.click()      
  }
  }
}, 1000)
@HarimanDhanjal

This comment has been minimized.

Copy link

@HarimanDhanjal HarimanDhanjal commented Dec 4, 2020

Sounds good! Thank you!
So if i unlike everything does this go off facebooks data base as well? or do they still have a copy?

@FilipLitwora

This comment has been minimized.

Copy link

@FilipLitwora FilipLitwora commented Dec 4, 2020

For fb in Polish

setInterval(() => {
  for (const Button of document.querySelectorAll('div[aria-label="Opcje działania"]')) {
    Button.click()
for (const remove of document.querySelectorAll('div[role="menuitem"]')) {
    remove.click()      
  }
  }
}, 1000)
@michelep

This comment has been minimized.

Copy link

@michelep michelep commented Dec 4, 2020

Just click on THIS link to get the correct username of your profile ;-)

https://www.facebook.com/me/allactivity/?category_key=LIKEDPOSTS&filter_hidden=ALL&filter_privacy=NONE

@2xa31k

This comment has been minimized.

Copy link
Owner Author

@2xa31k 2xa31k commented Dec 4, 2020

Just click on THIS link to get the correct username of your profile ;-)
@michelep thanks i will added this with your name

@zampemo

This comment has been minimized.

Copy link

@zampemo 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

This comment has been minimized.

Copy link

@IrakliK IrakliK commented Dec 17, 2020

@zampemo try re-running the script again ?

@nchlsschndr

This comment has been minimized.

Copy link

@nchlsschndr nchlsschndr commented Dec 18, 2020

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

@Zintom

This comment has been minimized.

Copy link

@Zintom 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! 👍

@2xa31k

This comment has been minimized.

Copy link
Owner Author

@2xa31k 2xa31k commented Jan 10, 2021

@Zintom Thank you I update the code .

@nchlsschndr

This comment has been minimized.

Copy link

@nchlsschndr nchlsschndr 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

This comment has been minimized.

Copy link

@Zintom 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.

@nchlsschndr

This comment has been minimized.

Copy link

@nchlsschndr nchlsschndr 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.

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