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

YousraBD commented Dec 23, 2021

Worked like a charm ! Thank you.

@luisnomad
Copy link

luisnomad commented Dec 24, 2021

Be careful with this, guys. After using it a couple of times, Twitter heavily penalized my account. It's like the algorithm has ostracised me, with 3k+ followers my engagement is next to null, and my tweet impressions are consistently below 20 in some cases. So much that I have decided to close my 10 years old account and start a new one.

@lionbytes
Copy link

lionbytes commented Dec 24, 2021

Did Twitter send you a warning of some sort? @luisnomad

@luisnomad
Copy link

luisnomad commented Dec 24, 2021

@lionbytes nope. I just noticed a sharp drop in engagement shortly after I mass "disliked" tweets. I never got an explanation, even though I explicitly asked support (publicly).

@maxime-paquin
Copy link

maxime-paquin commented Jan 27, 2022

How do you turn this off? I reached the maximum number of API requests and now if I manually unlike, it automatically relikes.

@vfanghao
Copy link

vfanghao commented Feb 8, 2022

Thanks!

@EduardoReisDev
Copy link

EduardoReisDev commented Mar 20, 2022

Thanks!!

@erbanku
Copy link

erbanku commented Mar 21, 2022

Thanks!

@AtalaySezen
Copy link

AtalaySezen commented Mar 23, 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!

@arshiardmhr
Copy link

arshiardmhr commented Apr 11, 2022

I used this code, but after a few tweets, the rest of the tweets I liked were not shown to me, but others can see them.

@FranciscoMoretti
Copy link

FranciscoMoretti commented Apr 21, 2022

The code from the last comment worked for me 👍

@knedl1k
Copy link

knedl1k commented May 5, 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 properly with over 25k likes. Thanks a lot!

@catielkerr
Copy link

catielkerr commented May 11, 2022

I used this code, but after a few tweets, the rest of the tweets I liked were not shown to me, but others can see them.

I had the same issue

@iMaz1n
Copy link

iMaz1n commented May 16, 2022

@jeremiah-k
Copy link

jeremiah-k commented May 22, 2022

I used the specified codes and 6700 likes do not appear when I enter my profile. But when I enter my own profile from someone else's account, the likes appear. Has anyone else experienced this situation?

Yep. Same.

@311298
Copy link

311298 commented Jun 1, 2022

works fine - 2022 may https://stackoverflow.com/a/71333246/6798139

It started un following person whom I follow

@311298
Copy link

311298 commented Jun 1, 2022

can anyone share me the latest code to unlike the tweets , because I tried all above solution still getting errors.
thanks in advance

@0xfoobar
Copy link

0xfoobar commented Jun 10, 2022

Had to add greater timeouts between liking and unliking

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

  await new Promise(r => setTimeout(r, 5000));

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

@Alex39-bot
Copy link

Alex39-bot commented Jun 21, 2022

How do I turn the code off???

@knedl1k
Copy link

knedl1k commented Jun 23, 2022

How do I turn the code off???

Just refresh the page, F5.

@WizardOfOoo
Copy link

WizardOfOoo commented Jul 3, 2022

I combined some of the above to make this:
Was slow, and didn't have much action on the screen, but it worked.
Chrome / Win 10

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

@dcole819
Copy link

dcole819 commented Aug 1, 2022

How do I remove the code??? My Twitter has been acting up since I did this I want it back to normal please help

@AlzheTV
Copy link

AlzheTV commented Aug 3, 2022

Working nice today.

@dcole819
Copy link

dcole819 commented Aug 3, 2022

It’s unliking things but it still shows up in my likes just without the heart…anyway to remove the code???

@partsp
Copy link

partsp commented Aug 10, 2022

still can't get it to work. it deletes the tweets but then they come back

@nonononono9
Copy link

nonononono9 commented Aug 14, 2022

Works for a bit and then stops, most likely because of the API but then everything it unfavorites comes back. Which 100% defeats the purpose of this.

@AlzheTV
Copy link

AlzheTV commented Aug 15, 2022

It’s unliking things but it still shows up in my likes just without the heart…anyway to remove the code???

@dcole819, CTRL+F5 or MAJ+F5 to stop the scripts correctly.

Sometime the API will block you for some minutes or hours if you have mass likes to "remove". 😁

still can't get it to work. it deletes the tweets but then they come back

@partsp same here, just got blocked by API because of too much tweet. retry later. ^^

@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