Skip to content

Instantly share code, notes, and snippets.

@ashander
Last active December 7, 2022 01:37
Show Gist options
  • Star 61 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save ashander/087ee26731c7eb68abc063fd299b8ba8 to your computer and use it in GitHub Desktop.
Save ashander/087ee26731c7eb68abc063fd299b8ba8 to your computer and use it in GitHub Desktop.
Delete all your favorites (unfavorite or unlike every tweet) on twitter.com (thx to @JamieMason and @b44rd for inspiring this)
// 1. Go to https://twitter.com/i/likes
// 2. Keep scrolling to the bottom repeatedly until all your favs are loaded.
// 3. Run this in your console (open in chrome by View > Developer > JavaScript Console)
// Notes: this may take a while if you have a lot of favs/likes
// you can only access your most recent ~2000 likes.
// inspired by https://gist.github.com/JamieMason/7580315
$('.ProfileTweet-actionButtonUndo').click()
@passmethemike
Copy link

Tried running this but get an error:

Uncaught TypeError: Cannot read property 'click' of null at :1:68

Is there a fix for this?

@ashander
Copy link
Author

ashander commented Aug 8, 2019

@passmethemike no clue offhand, sorry. twitter has redesigned the web front end so I'm not surprised if this no longer work. following @mochsner advice and using the api is a better bet if this no longer works

Copy link

ghost commented Aug 22, 2019

This surely work:

  1. Go to "like" page
  2. For num in range(1, $number_of_favorite_tweets)
    Press key " J ". Then press " L ";
  3. Can use Autohotkey (on windows) or Autokey (on Linux) for doing step 2.

@EmadAghaei
Copy link

None of the above solutions does NOT work. Please let us know if you have any more solution.

@aymericbeaumet
Copy link

aymericbeaumet commented Sep 4, 2019

@eaghayi: see this script which works with the latest Twitter version

@primroserobin
Copy link

how to get rid of phantom likes ?

Copy link

ghost commented Sep 3, 2020

does not work

@ashander
Copy link
Author

ashander commented Sep 3, 2020

@domibor19 see the other comments

@RRR2020-Temp
Copy link

Hi, I used the code to delete my twitter likes but it has left a lot of "ghost" likes behind. Anyone know how to resolve this?

@Devendrachauhan
Copy link

// The below js code remove the likes on twitter

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

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