Bulk-delete your old tweets, retweets, and replies from X/Twitter using your official Twitter archive.
Uses Playwright to drive a real Chrome browser — deletes tweets one by one with configurable delays and cooldowns. Resumable: progress is saved after every deletion.
- Go to x.com/settings/download_your_data
- Request your archive (may take 24–48h for X to prepare it)
- Download the ZIP and extract everything into the
archive/folder
npm installEdit x-reset.json — change username to your own handle (without @).
npm startA Chrome window opens. Log in to X manually (one-time). The tool then deletes tweets automatically. Press Ctrl+C to stop — progress is saved.
| Key | Default | Description |
|---|---|---|
username |
"felipefrf" |
Your X handle without @ |
deleteTweets |
true |
Delete your regular tweets |
deleteRetweets |
true |
Delete your retweets |
deleteReplies |
true |
Delete your replies |
minAgeDays |
30 |
Only delete tweets older than N days. 0 = all ages |
| Key | Default | Description |
|---|---|---|
minDelayMs |
2000 |
Minimum wait between deletions (ms) |
maxDelayMs |
2000 |
Maximum wait between deletions (ms) |
cooldownAfter |
25 |
Deletions before a cooldown break |
cooldownMs |
120000 |
Cooldown duration in ms (120s = 2 min) |
maxDeletions |
0 |
Stop after N deletions. 0 = unlimited |
headed |
true |
Show browser window (false = headless) |
Proven safe profile (used to delete 1,429 tweets with zero rate-limit issues): Delays 2s, 2-minute cooldown every 25 deletions.
Aggressive (test at your own risk):
"minDelayMs": 0, "maxDelayMs": 0, "cooldownAfter": 25, "cooldownMs": 60000
- Parses
archive/data/tweets.js(andtweets-part*.js) to extract all tweet IDs - Filters by age, type (tweet/RT/reply) per your config
- Skips IDs already processed (stored in
state.json) - Opens each tweet URL, clicks
...>Delete> confirm - Saves progress after each successful deletion
- If X shows a rate-limit page, the tool backs off for 2–8 minutes and continues
- Rate-limited tweets are not marked as deleted — they retry on next run
- Deleted/missing tweets are detected and skipped automatically
- Session expiry triggers a re-login prompt (or graceful stop if unattended)
- Ctrl+C saves progress and closes cleanly
state.json— tracks which IDs have been deleted. Safe to delete to start freshbrowser-profile/— persistent browser profile (cookies, localStorage). Delete if login gets stuck- Run
npm startanytime — it picks up where it left off
| Problem | Solution |
|---|---|
| Can't log in (Google/security blocks) | The tool uses a persistent Chrome profile. If X flags it, delete browser-profile/ and try again |
| "Session expired" during run | If you're at the computer, just log in again in the browser window. If unattended, the tool stops gracefully and saves progress |
| "Tweet article not found" | The tweet may already be deleted or X didn't render the page in time. These are skipped and counted as deleted |
| Rate limited mid-run | The tool detects the rate-limit page and backs off automatically for several minutes |
npm start crashes on login |
Delete browser-profile/ and state.json, then run npm start again |
MIT