Steven Prins

Steven Prins

Javscript code to delete all your likes on Twitter

15-02-2023 | 91 words | 1 minute reading time | Tags:

Below some Javascript code to delete (unlike) all your likes on Twitter. You can run this code in the browser console.

1setInterval(function() {
2  var likeButtons = document.querySelectorAll('[data-testid="unlike"]');
3  for (var i = 0; i < likeButtons.length; i++) {
4    likeButtons[i].click();
5  }
6  window.scrollTo(0, document.body.scrollHeight);
7}, 1000);

You need to stop the script when you see requests failing (429 too many requests) because of the Twitter rate limit. You can stop the script by pressing Ctrl + C in the console. You can do around 500 requests per 15 minutes.