Ever wanted to delete all your tweets from X (Twitter) but only found broken/expensive tools? You are in the right place.
- Go to: https://x.com/{username}/with_replies
- Modify the strings marked as "EDIT"
- Open the console and run the following JavaScript code:
var nameToFind = "YOUR TWITTER NAME"; // EDIT
var deleteStr = "Delete"; // EDIT: USE YOUR OWN BROWSER LANGUAGE HERE
/* define a function to delete tweets */
async function unTweet() {
const tweets = Array.from(document.querySelectorAll('article[data-testid="tweet"]'))
.filter(article => article.textContent.includes(nameToFind));
for (const tweet of tweets) {
// click the horizontal caret in each tweet
tweet.querySelector('button[data-testid="caret"]').click();
await new Promise(r => setTimeout(r, 500));
// find delete option
const menuItems = document.querySelectorAll('div[data-testid="Dropdown"] div[role="menuitem"]');
const deleteBtn = Array.from(menuItems).find(el => el.textContent.includes(deleteStr));
// if exists
if (deleteBtn) {
deleteBtn.click()
await new Promise(r => setTimeout(r, 500));
// confirm deletion
const confirmBtn = document.querySelector('button[data-testid="confirmationSheetConfirm"]');
confirmBtn?.click();
await new Promise(r => setTimeout(r, 1000));
}
}
// scroll page
window.scrollBy(0, 500);
await new Promise(r => setTimeout(r, 500));
}
/* call it every 5000 ms (can be changed) */
var myProc = setInterval(unTweet, 5000)- When the bottom is reached, type:
/* stop the process */
clearInterval(myProc)Don't forget to checkout how to remove likes and retweets!
Update: November, 1st (2025)