Date-filtered tweet deletion tool for X (Twitter). Safely delete old tweets while protecting recent ones.
Available as both a Desktop GUI App (Electron) and a CLI tool.
- Desktop GUI App: Modern dark-themed interface with custom titlebar
- Date-based filtering: Delete tweets before a specific month/year
- Protection layer: Never touches tweets after a specified date
- Content type selection: Choose to delete Posts, Replies, and/or Reposts
- Multi-language support: Works with X in English, Spanish, French, German, Portuguese, Russian, Japanese, Korean, and Chinese
- Session persistence: Saves login session for future runs (24-hour expiry)
- Account verification: Ensures you're logged into the correct account
- Configurable targets: Set how many tweets to delete per run
Download from the Releases page:
- Portable:
Delete My Tweets 1.3.41.exe- No installation needed, just run - Installer:
Delete My Tweets Setup 1.3.41.exe- Traditional Windows installer
git clone https://github.com/Kepners/deletemytweets.git
cd deletemytweets
npm install
npx playwright install chromium- Launch: Double-click
START_APP.bator runnpm start - Set Handle: Click on the profile section to enter your X handle
- Configure:
- Select content types (Posts, Replies, Reposts)
- Set "Delete Before" date (month + year)
- Set "Protect After" date (month + year)
- Rolling window is enabled by default in the desktop app on new installs, so the range follows the current month automatically
- Set target count
- Toggle "Show browser window" for faster deletion + live view
- Start: Click "Start Cleanup"
- Login: If needed, log in to X in the browser window that opens
# Delete up to 200 tweets from 2014 and older
node index.js yourusername
# Or with environment variables
PROFILE_HANDLE=yourusername node index.js
# With custom settings
PROFILE_HANDLE=yourusername TARGET=100 DELETE_YEAR_AND_OLDER=2020 node index.js
# Rolling window examples
ROLLING_WINDOW=true ROLLING_MONTHS=3 SLIDER_MODE=delete HANDLE_REPOSTS=true node index.js yourusername
ROLLING_WINDOW=true ROLLING_MONTHS=3 SLIDER_MODE=protect HANDLE_REPOSTS=true node index.js yourusername# Install dependencies
npm install
# Run the GUI app
npm start
# Build distributable packages (portable + installer)
npm run build
# Output in dist/ folder:
# - Delete My Tweets 1.3.41.exe (portable)
# - Delete My Tweets Setup 1.3.41.exe (installer)| Setting | Description |
|---|---|
| Content Types | Checkboxes to include Posts, Replies, and/or Reposts |
| Delete Before | Month and year threshold - delete tweets older than this |
| Protect After | Month and year threshold - never delete tweets newer than this |
| Rolling window | When enabled, the selected range follows the current month automatically. This is the desktop app default on new installs |
| Months | Rolling window length in calendar months |
| Target Count | Maximum number of tweets to delete per run |
| Speed | Aggressive (fast, 0.6-1s delays), Normal (1.2-2.2s), or Conservative (2.5-4s) |
| Show browser window | Toggle visible browser (faster + watch deletions live) |
| Variable | Description |
|---|---|
PROFILE_HANDLE |
Your X handle (without @). Pass as arg or env var. |
| Variable | Default | Description |
|---|---|---|
DELETE_MONTH |
12 |
Delete tweets before this month (1-12) |
DELETE_YEAR |
2014 |
Delete tweets before this year |
PROTECT_MONTH |
current month |
Protect tweets after this month (1-12) |
PROTECT_YEAR |
current year |
Protect tweets from this year and newer |
DELETE_YEAR_AND_OLDER |
2014 |
(Legacy) Delete tweets from this year and older |
PROTECT_YEAR_AND_NEWER |
current year |
(Legacy) Never delete tweets from this year and newer |
SLIDER_MODE |
delete |
delete to delete the selected window, protect to keep it and delete older tweets |
ROLLING_WINDOW |
false |
When true, treat the selected window as relative to the current month |
ROLLING_MONTHS |
3 |
Rolling window size in months |
| Variable | Default | Description |
|---|---|---|
TARGET |
200 |
Maximum tweets to delete per run |
INCLUDE_POSTS |
true |
Delete regular posts |
INCLUDE_REPLIES |
true |
Delete replies |
HANDLE_REPOSTS |
false |
Also undo retweets/reposts |
SPEED |
normal |
Speed preset: aggressive, normal, or conservative |
HEADLESS |
false |
Run browser in headless mode |
| Variable | Default | Description |
|---|---|---|
MIN_DELAY_MS |
1200 |
Minimum delay between actions (ms) |
MAX_DELAY_MS |
2200 |
Maximum delay between actions (ms) |
LOGIN_WAIT_MS |
180000 |
Time to wait for manual login (3 min) |
| Variable | Default | Description |
|---|---|---|
MAX_SCROLL_PASSES |
5 |
Maximum scroll attempts per batch |
SCROLL_MIN_WAIT_MS |
300 |
Minimum scroll wait (ms) |
SCROLL_MAX_WAIT_MS |
600 |
Maximum scroll wait (ms) |
DELETE_YEAR_AND_OLDER=2020 PROTECT_YEAR_AND_NEWER=2024 node index.js myhandleINCLUDE_POSTS=false INCLUDE_REPLIES=true DELETE_YEAR_AND_OLDER=2022 PROTECT_YEAR_AND_NEWER=2023 node index.js myhandleROLLING_WINDOW=true ROLLING_MONTHS=3 SLIDER_MODE=delete HANDLE_REPOSTS=true node index.js myhandleROLLING_WINDOW=true ROLLING_MONTHS=3 SLIDER_MODE=protect HANDLE_REPOSTS=true node index.js myhandleLegacy saved configs that still use fixed dates will show a warning banner in the GUI until you switch to rolling window.
HEADLESS=true node index.js myhandleHANDLE_REPOSTS=true node index.js myhandleOn first run (or if session expired after 24 hours):
- Browser opens to x.com
- Log in manually within 3 minutes
- App verifies you're logged into the correct account
- Session is saved per-account to
x_auth_<handle>.json - Future runs use saved session (until 24-hour expiry)
- Never deletes recent tweets: Configurable protection date
- Skips unknown dates: If date can't be determined, tweet is skipped
- Account verification: Confirms logged-in account matches specified handle
- Per-account sessions: Separate session storage for each X account
- 24-hour session expiry: Forces re-login daily for security
- Configurable delays: Avoid rate limiting
deletemytweets/
├── app.html # Electron GUI interface
├── electron-main.js # Electron main process
├── index.js # CLI tool / core logic
├── package.json # Dependencies and build config
├── START_APP.bat # Windows launcher script
├── icon.ico # App icon
└── dist/ # Built executables (after npm run build)
├── Delete My Tweets 1.3.41.exe # Portable executable
└── Delete My Tweets Setup 1.3.41.exe # Windows installer
- Electron - Desktop app framework
- Playwright - Browser automation
- better-sqlite3 - Direct Edge cookie access for logout
- Chalk/Boxen/Ora - Terminal UI (CLI mode)
- electron-builder - App packaging
- Dynamic Login/Logout button - Button changes state based on session
- Direct Edge cookie clearing - Logout clears cookies without opening browser (uses SQLite)
- First-time login notification - Helpful prompt for new users
- Live progress updates - Stats update immediately when tweets are deleted/protected/skipped
- Per-account history - Deletion history saved locally for each account
Glassmorphic dark theme with neon accents:
| Element | Color | Hex |
|---|---|---|
| Primary | Magenta | #FF00E6 |
| Secondary | Cyan | #00FFD1 |
| Accent | Purple | #7C3BFF |
| Background | Dark | #1B0B3B |
| Alert | Coral | #FF2A6D |
MIT