Local, preview-first X profile cleanup for an official X data export.
This is a browser-console JavaScript tool. It does not use api.x.com, does not require a developer account, and does not upload the archive. It runs on x.com while you are logged in and sends deletion requests through the authenticated X web session.
- Make a fresh backup of the archive. Deletion is permanent.
- Open
https://x.comin the browser and log into the account you intend to clear. - Open Developer Tools → Console.
- Copy the complete contents of
tweet-clear.jsinto the console and press Enter. - Select
archive/data/tweets.jsfrom the archive folder. - Review the counts and sample items. Posts, replies, and retweets are selected by default.
- Click
Review and delete selected items, then type the exact confirmation phrase. - Leave the tab open. If X rate-limits the session, the script waits and retries. You can stop safely; successful IDs are saved locally and skipped on the next run with the same archive.
The archive parser supports the current format:
window.YTD.tweets.part0 = [ ... ]
It also accepts older JSON-like export files containing objects with tweet.id_str or tweet.tweet_id.
- The archive is a snapshot. Posts made after it was downloaded are not included; request a fresh archive and run it again if needed.
deleted-tweets.jsis not selected because those posts are already deleted.- Likes, bookmarks, follows, direct messages, and profile data are outside this script's scope.
- Retweets are identified from the archive's
retweetedflag or the legacyRT @...text prefix. Quote posts remain ordinary posts. - X's internal web endpoint and request identifiers can change without notice. A 401/403 stops the run rather than repeatedly retrying.
- X does not publish a dependable limit for this internal endpoint. The default pacing is approximately 1.8–3 seconds between successful deletion requests, with longer backoff for 420/429 responses.
- X warns that mass-deletion programs may cause account restrictions. Use this only for your own account and accept that risk.
No credentials or archive contents are sent anywhere except the normal requests to X from the logged-in browser tab. The script stores only completed tweet IDs in that browser's local storage so an interrupted run can resume.