Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
  }
  window.scrollTo(0, document.body.scrollHeight)
}, 1000)
@MaGpeA

This comment has been minimized.

Copy link

@MaGpeA MaGpeA commented Sep 22, 2019

Excelent, it worked!

@Noahhhhhr

This comment has been minimized.

Copy link

@Noahhhhhr Noahhhhhr commented Sep 24, 2019

It works! Thank u.

@belous

This comment has been minimized.

Copy link

@belous belous commented Oct 5, 2019

Nice 👍

@conchordspannerman

This comment has been minimized.

Copy link

@conchordspannerman conchordspannerman commented Oct 7, 2019

Works brilliantly, thanks so much 👍🏻

@MikaCaldera

This comment has been minimized.

Copy link

@MikaCaldera MikaCaldera commented Oct 24, 2019

I appreciate this! Great solution for deleting past twitter likes. Gracias!

@leoebrown

This comment has been minimized.

Copy link

@leoebrown leoebrown commented Oct 28, 2019

I would like this, but I might regret it later, so I'll just say: thanks! Worked like magic!

@bartier

This comment has been minimized.

Copy link

@bartier bartier commented Oct 31, 2019

Thanks. It works nicely =)

@HashRaygoza

This comment has been minimized.

Copy link

@HashRaygoza HashRaygoza commented Nov 4, 2019

Works like a charm :D!

@lccezinha

This comment has been minimized.

Copy link

@lccezinha lccezinha commented Nov 14, 2019

Excellent! It works weel! 🚀

@joshamore

This comment has been minimized.

Copy link

@joshamore joshamore commented Dec 4, 2019

Awesome works as described!

@Ange92

This comment has been minimized.

Copy link

@Ange92 Ange92 commented Dec 7, 2019

How old were the deleted tweets? I'm stuck with about 2500 favorites/likes and not able to access those prior to 2018 till 2013 and I'd like to try this script.

@aymericbeaumet

This comment has been minimized.

Copy link
Owner Author

@aymericbeaumet aymericbeaumet commented Dec 10, 2019

@Ange92 I guess you can only delete what's being displayed on Twitter, it mostly works but is still quite a hacky solution :)

@Ange92

This comment has been minimized.

Copy link

@Ange92 Ange92 commented Dec 10, 2019

Many thx for your answer! I'll let you know about the result once I run your script.

@nightzw

This comment has been minimized.

Copy link

@nightzw nightzw commented Jan 7, 2020

First and only solution that has worked for me. No other scripts/apps did. Thanks a lot!

@hpiedcoq

This comment has been minimized.

Copy link

@hpiedcoq hpiedcoq commented Jan 19, 2020

Works like a charm! Many thanks!

@ndrmnl

This comment has been minimized.

Copy link

@ndrmnl ndrmnl commented Jan 19, 2020

It removed many of them, but then at some point it started unliking tweets without actually removing :( So now I ended up with a bunch of "liked tweets" which are not actually liked, i.e. the heart icon is gray, not red.
Any idea what can be done in this case? I found out that if I like them again and then unlike they disappear, but I don't want all of my followers to get notifications of me liking hundreds of their old tweets 😅

@hpiedcoq

This comment has been minimized.

Copy link

@hpiedcoq hpiedcoq commented Jan 19, 2020

@varadhjain

This comment has been minimized.

Copy link

@varadhjain varadhjain commented Jan 21, 2020

this worked! thank you.

@aymericbeaumet

This comment has been minimized.

Copy link
Owner Author

@aymericbeaumet aymericbeaumet commented Jan 21, 2020

@ndrmnl @hpiedcoq Yes this approach is mostly a hack, and generates a lot of requests from your user account. So, while the tweets might be unliked, maybe the information is not properly propagated to the service in charge of refreshing the list of liked tweets (wild guess). Sounds like a bug, but one could argue it's not really the expected workflow.

@rafaelvebr

This comment has been minimized.

Copy link

@rafaelvebr rafaelvebr commented Feb 6, 2020

This is awesome! Thanks!

@andybrice

This comment has been minimized.

Copy link

@andybrice andybrice commented Feb 17, 2020

This is great, thank you. Although I had to refresh and run it a few times to make sure everything was well-and-truly nuked.

@rad-hombre

This comment has been minimized.

Copy link

@rad-hombre rad-hombre commented Feb 20, 2020

Great script! Worked for me. Much appreciated 🤙

@DeveDikeni

This comment has been minimized.

Copy link

@DeveDikeni DeveDikeni commented Feb 21, 2020

adamsın tşk you man thx

@kstad

This comment has been minimized.

Copy link

@kstad kstad commented Mar 27, 2020

I've been looking for this forever! Thank you!

@lopezpappalardo

This comment has been minimized.

Copy link

@lopezpappalardo lopezpappalardo commented Apr 17, 2020

¡Great! Worked for me. Thanks.

@kayceegeek

This comment has been minimized.

Copy link

@kayceegeek kayceegeek commented Apr 21, 2020

Works superbly well. Thanks!

@TeresaCS

This comment has been minimized.

Copy link

@TeresaCS TeresaCS commented Apr 28, 2020

holy shit, i think it's working! but it's probably gonna take forever cuz i have almost 200k likes...

@TeresaCS

This comment has been minimized.

Copy link

@TeresaCS TeresaCS commented Apr 28, 2020

holy shit, i think it's working! but it's probably gonna take forever cuz i have almost 200k likes...

forgot to say, thanks so much!!!!

@albertamores

This comment has been minimized.

Copy link

@albertamores albertamores commented Apr 30, 2020

It worked! Thanks!

@leuthier

This comment has been minimized.

Copy link

@leuthier leuthier commented May 5, 2020

Thanks!

@RoeltaNcRave

This comment has been minimized.

Copy link

@RoeltaNcRave RoeltaNcRave commented May 16, 2020

thank you very much!

@vduglued

This comment has been minimized.

Copy link

@vduglued vduglued commented May 23, 2020

Nice work!

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented May 25, 2020

How old were the deleted tweets? I'm stuck with about 2500 favorites/likes and not able to access those prior to 2018 till 2013 and I'd like to try this script.

Hey guys, hey @ aymericbeaumet,

thanks for this solution. It works – but only for all tweets which have a red heart. These are up to about 3200 Tweets due to limits of Twitter.

I have no Java Script Skills at all. But I guess it must be possible to rewrite this script in a way to first like the old tweets again and than to dislike. I guess it should only be about one line of code more.

Could anyone write this line for me?

I know that there will be notifications to the owner of that tweets, but I guess if you protect your account, it's okayish.

All the best.
A.

@aymericbeaumet

This comment has been minimized.

Copy link
Owner Author

@aymericbeaumet aymericbeaumet commented May 25, 2020

I have no Java Script Skills at all. But I guess it must be possible to rewrite this script in a way to first like the old tweets again and than to dislike.

You can use the same piece of code and just change the selector from 'div[data-testid="unlike"]' to 'div[data-testid="like"]'. But like you've said, this will trigger a bunch of notifications.

@hutt

This comment has been minimized.

Copy link

@hutt hutt commented May 26, 2020

The code to like and then unlike your tweets would be:

setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="like"]')) {
    d.click()
  }

  for (const e of document.querySelectorAll('div[data-testid="unlike"]')) {
    e.click()
  }

  window.scrollTo(0, document.body.scrollHeight)
}, 1000)
@FocusWho

This comment has been minimized.

Copy link

@FocusWho FocusWho commented Jun 10, 2020

Just be aware the "ghost" likes which may not be even gone with re-like and unlike (again) may be due to daily rate limit. I need to test myself, the 3200 seems mythical (?) as I hit ghost likes with 5k or so.

Anyways in case someone else than me wants to delete all RT's, replies and tweets from with replies as well:

https://gist.github.com/FocusWho/5a8e74895293eae0071cec612477c72f

@lowkiigelo

This comment has been minimized.

Copy link

@lowkiigelo lowkiigelo commented Jul 2, 2020

Hi guys! I need help because when I tried first, it went well. My 17K likes went to 14.1K likes but it stopped there. Some likes still appeared on my likes despite it isn’t liked already. Is there a way to make them disappear?

@ConnorGold

This comment has been minimized.

Copy link

@ConnorGold ConnorGold commented Jul 14, 2020

Hello! I don't know much about java or the console, but I used this and it worked great until it stopped working, perhaps due to a daily limit.

I'd like to remove it and then start again, but I can't seem to figure out how? Right now the script runs whenever I open the Likes page, and I can't figure out how to get rid of it. Help! How do I remove the script and then add it again later?

@hana131

This comment has been minimized.

Copy link

@hana131 hana131 commented Jul 19, 2020

where is console, i use mobile browser please help me, i done step 1 but i don’t know what should i do and what page should i open to enter java code

@Pistolette

This comment has been minimized.

Copy link

@Pistolette Pistolette commented Jul 20, 2020

Worked great, but stopped after about 3k likes. Is that it, or can I run it again after a day (or week?) to finish the job?

@Kaywinnit

This comment has been minimized.

Copy link

@Kaywinnit Kaywinnit commented Jul 20, 2020

Thank you so much!

@HeyHanna

This comment has been minimized.

Copy link

@HeyHanna HeyHanna commented Aug 1, 2020

It removed many of them, but then at some point it started unliking tweets without actually removing :( So now I ended up with a bunch of "liked tweets" which are not actually liked, i.e. the heart icon is gray, not red.
Any idea what can be done in this case? I found out that if I like them again and then unlike they disappear, but I don't want all of my followers to get notifications of me liking hundreds of their old tweets
I got that problem, any solution for that please?

@ryanallen

This comment has been minimized.

Copy link

@ryanallen ryanallen commented Aug 13, 2020

Thank you <3

@primroserobin

This comment has been minimized.

Copy link

@primroserobin primroserobin commented Aug 22, 2020

it worked but how do i get rid of the phantom likes ?

@lzkill

This comment has been minimized.

Copy link

@lzkill lzkill commented Aug 26, 2020

Great! Worked flawlessly!

@GHUser727

This comment has been minimized.

Copy link

@GHUser727 GHUser727 commented Aug 29, 2020

Thanks for this! Has anyone with the ghost/phantom likes problem found a solution? Is there any chance they'll disappear with time? (I now have a ton of phantom likes from running this; trying to figure out my next step.) Thanks!

@doorbash

This comment has been minimized.

Copy link

@doorbash doorbash commented Aug 29, 2020

Works like a mard 👍

@alexeysolonets

This comment has been minimized.

Copy link

@alexeysolonets alexeysolonets commented Aug 31, 2020

Brilliant!

@Chiko-Albaraa

This comment has been minimized.

Copy link

@Chiko-Albaraa Chiko-Albaraa commented Sep 3, 2020

Thank U so much bro

@fe404

This comment has been minimized.

Copy link

@fe404 fe404 commented Sep 17, 2020

The code to like and then unlike your tweets would be:

setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="like"]')) {
    d.click()
  }

  for (const e of document.querySelectorAll('div[data-testid="unlike"]')) {
    e.click()
  }

  window.scrollTo(0, document.body.scrollHeight)
}, 1000)

Hi!! After I used this I got all my 35k likes deleted, but now I can't like anything :(. Does anyone know how to change this?

@luisnomad

This comment has been minimized.

Copy link

@luisnomad luisnomad commented Sep 17, 2020

Genius! Anyone running this after watching The Social Dilemma?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.