This repo is a local fork of the original TweetXer project.
This fork is intended to delete only tweets manually created by the account owner:
- original tweets
- replies
- quote tweets
This fork skips:
- retweets
You can use this script to delete your own tweets from your data export, but you need tweets.js or tweet.js for this fork to work correctly.
See TweetXer v2.md for the fork-specific behavior and limitations.
Because this automates the deletion, it may get your account banned. Not a bad outcome.
English: youtube.com/watch?v=jB1-z6LbX5w
German: youtube.com/watch?v=HmQ7_ZgVNxg
- Request (takes several days) and download your Data Export and unzip it
- Log into your Twitter account
- Open the browser console (F12 or cmd+option+i)
- Open the local tweetXer.js file from this fork, copy its contents, paste the whole script into the console, and press enter
- A light blue bar appears at the top of the window
- Use the file picker to select your
tweets.jsortweet.jsfile - Do not use
tweet-headers.jsin this fork, because it does not contain enough metadata to safely skip retweets - Wait for your user-authored tweets to be deleted
If the process is interrupted at any time, you can use the advanced options to enter how many tweets were already processed in the previous run. In this fork, the original automatic skip heuristic is disabled because the archive is filtered to skip retweets first, so the counts are no longer directly comparable.
If you rerun the script without entering a manual skip count, the banner may still say something like Deleting 7653 of 7653 user-authored tweets again. That number comes from the filtered archive queue in tweets.js or tweet.js, not from a live recount of what is still visible on your profile.
That means a repeated total after a restart does not prove that earlier deletions were lost. It only means the script rebuilt the same queue from the same archive file. Previously deleted tweets can return 404 and are treated as already deleted, but entering a manual skip count is still recommended so the rerun does not waste time replaying already-processed IDs.
Instead of copy-pasting the script each time, you can create a local userscript in a manager such as Violentmonkey, FireMonkey or Tampermonkey and paste the contents of the local tweetXer.js file into it.
Do not install the upstream GreasyFork script for this forked repo. It is a different distribution artifact and may update you back to upstream behavior.
This fork does not currently publish its own hosted userscript install or auto-update URL.
Manual local userscript setup may work on Android if your browser and userscript manager support it, but the upstream GreasyFork install instructions do not apply to this fork.
The original upstream Android tutorial is not a safe install path for this fork because it points to the upstream script.
Remote userscript instructions from upstream do not apply to this fork because this repo does not publish a hosted update URL.
If you want to use it on iPhone or iPad, use a userscript tool that lets you create a script locally and paste in the contents of tweetXer.js.
Never use something like this from an untrusted source. In this fork, the script reads tweets.js or tweet.js, filters out retweet-shaped entries, builds a delete queue from the remaining tweet IDs, and then sends authenticated fetch() requests to X/Twitter using the logged-in browser session.
Faster deletion inspired by github.com/Lyfhael/DeleteTweets
Because bookmarks aren't included in the Twitter data export, there is a button under "Advanced options" to export them.
This option is disabled in this fork. Slow mode cannot reliably guarantee retweet exclusion, so it is intentionally unavailable here.
To delete DMs, you select the direct-message-header.js file instead of the tweet-headers.js file. Once it's done, reload the page, paste TweetXer into the console again and select the direct-message-group-headers.js file to remove message groups. If the process gets interrupted for whatever reason, you can enter how many messages where deleted before under "Advanced options" before selcting the file.
According to former engineers, DMs are removed from the server if all sides remove them from their inbox.
Under "Advanced options" you can automatically unfollow everyone. You may need to rerun with some time in between because of rate limits.
-
I can't paste the script.
Your browser tries to protect you from pasting some random script you found. Type "allow pasting" (Firefox) or "allow pasting" (Chrome) and hit enter to confirm that you know what you are doing.
-
X Corp doesn't send me my data export.
Try requesting it through their Privacy Form.
- Not all Tweets got removed.
Check if the ID of the remaining Tweet is in your data export. This fork can only remove what is present in tweets.js / tweet.js, and it intentionally preserves retweets. A manually written tweet that begins with the literal text RT @ may also be preserved because the archive data does not reliably distinguish that case from a real retweet.
- No Tweets are visible on the profile, but Tweet count shows there are still Tweets left.
In this fork, remaining tweet count can be caused by retweets that were intentionally skipped. Sometimes those retweets are from accounts that got deactivated or banned, and they may not be removable through normal profile views.
- Likes aren't removed.
Only the last few hundred can be be removed. Even by hand. There is nothing you can do other than deleting your whole account. Or reliking Tweets to unlike them afterwards which will probably get your account locked for spamming.
-
Browser crashes
This happens more often with Chrome and Chrome-based browsers. Especially when removing more than 15 k Tweets. Closing the browser console while it runs seems to reduce the crashes.
-
It worked and you are thankful.
Awesome. Share the script on whatever platform you are using now to give others the option to delete their Tweets. Support me to keep creating things like this: buymeacoffee.com/lucahammer