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)
@MBUMILA
Copy link

MBUMILA commented Sep 4, 2022

It worked! thanks

@jacobsammon
Copy link

jacobsammon commented Sep 11, 2022

I'm not so good with Javascript - does anyone know how to modify this to unlike Tweets which contain a certain phrase?- eg only unlike Tweets containing the phrase 'boiled eggs'.

@dystorwell
Copy link

dystorwell commented Sep 26, 2022

hello there.
I don't know why but it doesn't work. here's a screenshot of the error.
it worked for a hundred of likes and then stopped.
keep in mind I don't know anything about java.
have a good day :)

Schermata 2022-09-26 alle 21 18 17

edit. worked, then all my likes came back, including the ones I unliked before using this...

@ChitranshuV
Copy link

ChitranshuV commented Oct 12, 2022

setInterval(() => { for (const d of document.querySelectorAll('div[data-testid="unlike"]')) { d.click() } window.scrollTo(0, document.body.scrollHeight) }, 10000)

setInterval 5000 did not work on me. If you have more than 2000 likes, like me. Try 10000 for setInterval, it worked.

Anyway, thanks!

Working for me as of 12th Oct 2022. The only issue is that it starts throwing errors like api/graphql after some time. I take 5 mins break and restart it and it works great. There is rate limit of 900 requests every 15 minutes. https://developer.twitter.com/en/docs/twitter-api/rate-limits

Is there any code similarly for deleting tweets&repllies ??

@Kirytah
Copy link

Kirytah commented Oct 16, 2022

I haven't found any. If you find one please let me know.

@mscdo
Copy link

mscdo commented Nov 11, 2022

It worked for a moment, but as others said, the tweets come back. Still finding an answer to that.

@WizardOfOoo
Copy link

WizardOfOoo commented Nov 12, 2022

setInterval(() => { for (const d of document.querySelectorAll('div[data-testid="unlike"]')) { d.click() } window.scrollTo(0, document.body.scrollHeight) }, 10000)
setInterval 5000 did not work on me. If you have more than 2000 likes, like me. Try 10000 for setInterval, it worked.
Anyway, thanks!

Working for me as of 12th Oct 2022. The only issue is that it starts throwing errors like api/graphql after some time. I take 5 mins break and restart it and it works great. There is rate limit of 900 requests every 15 minutes. https://developer.twitter.com/en/docs/twitter-api/rate-limits

Is there any code similarly for deleting tweets&repllies ??

https://tweetdelete.net/

@lionbytes
Copy link

lionbytes commented Nov 13, 2022

setInterval(() => { for (const d of document.querySelectorAll('div[data-testid="unlike"]')) { d.click() } window.scrollTo(0, document.body.scrollHeight) }, 10000)
setInterval 5000 did not work on me. If you have more than 2000 likes, like me. Try 10000 for setInterval, it worked.
Anyway, thanks!

Working for me as of 12th Oct 2022. The only issue is that it starts throwing errors like api/graphql after some time. I take 5 mins break and restart it and it works great. There is rate limit of 900 requests every 15 minutes. https://developer.twitter.com/en/docs/twitter-api/rate-limits

Is there any code similarly for deleting tweets&repllies ??

I modified the code a while ago. It worked for me, you just need to run it and go do something while it deletes the tweets:
https://gist.github.com/lionbytes/2e8ad01d0ec318354aa5e95b746c7e54

@osmanbowser
Copy link

osmanbowser commented Nov 16, 2022

Works on Chrome! Thanks!

@chriiisclm
Copy link

chriiisclm commented Nov 18, 2022

nice still works on chrome, tab should be open tho.

@qoqnus13
Copy link

qoqnus13 commented Nov 27, 2022

Hi,
How can I limit this code to a time period or a username? I don't want all likes to be removed and only want to remove the likes of a particular account

@dafunks
Copy link

dafunks commented Nov 28, 2022

Just so you all know, if you use GreaseMonkey you can easily do this with a script:
https://stackoverflow.com/questions/64863099/deleting-tweets-with-js-console/71333246#71333246 and it works really well.

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