Ever wanted to delete all your retweets from X (Twitter) but only found broken/expensive tools? You are in the right place.
- Go to: https://x.com/{username}/with_replies
- Open the console and run the following JavaScript code:
/* define a function to delete retweets */
async function unRetweet() {
const unretweetBtns = document.querySelectorAll('button[data-testid="unretweet"]')
for (const btn of unretweetBtns) {
btn.click();
// wait a bit
await new Promise(r => setTimeout(r, 150));
document.querySelectorAll('div[data-testid="unretweetConfirm"]')[0].click();
// again
await new Promise(r => setTimeout(r, 150));
}
// scroll window by 500 lines
window.scrollBy(0, 500);
}
/* call it every 2000 ms (can be changed) */
var myProc = setInterval(unRetweet, 2000)- When the bottom is reached, type:
/* stop the process */
clearInterval(myProc)- Don't forget to checkout how to remove likes and tweets!
Thanks, it works like a charm.