Skip to content

Instantly share code, notes, and snippets.

@bracca95
Last active March 12, 2023 06:39
Show Gist options
  • Save bracca95/89504862d3c802f617794a2b8e42b94d to your computer and use it in GitHub Desktop.
Save bracca95/89504862d3c802f617794a2b8e42b94d to your computer and use it in GitHub Desktop.
delete-retweets-from-twitter.md

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

  1. Go to: https://twitter.com/{username}/with_replies
  2. Open the console and run the following JavaScript code:
/* define a function to delete retweets */
function unRetweet() {
	for (const d of document.querySelectorAll('div[data-testid="unretweet"]')) {
		d.click();
		document.querySelectorAll('div[data-testid="unretweetConfirm"]')[0].click();
	}
	// scroll window by 500 lines
	window.scrollBy(0, 500);
}

/* call it every 5000 ms (can be changed) */
var myProc = setInterval(unRetweet, 5000)
  1. When the bottom is reached, type:
/* stop the process */
clearInterval(myProc)
  1. Don't forget to checkout how to remove likes and tweets!
@Vaibhav5757
Copy link

Thanks, it works like a charm.

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