x-cleanup

Delete all your posts and replies and undo your reposts on X, from your own browser. One script you paste into the console. No install, no API keys, no third-party login. Likes are left alone.

Read the source GitHub

Deletions are permanent. X has no undo. Download your archive first (Settings → Your account → Download an archive) if you want a copy.

How to use it

  1. Sign in to x.com on a desktop browser.
  2. Open your profile's Replies tab: https://x.com/<your-username>/with_replies
  3. Open the console: F12, or Cmd Option J on a Mac, then the Console tab.
  4. Paste the script and press Enter. If Chrome blocks pasting, type allow pasting and press Enter first.
  5. Click OK to confirm. Progress prints in the console. Keep the tab open and visible until the summary appears.

To stop at any point:

window.stopXCleanup = true

Why it is safe to run

Runs only on your page

It stops unless it is on x.com, on a profile tab, and that profile matches the signed-in account.

The script calls no server

No API key and nothing sent anywhere. It clicks the same menus you would.

Readable in five minutes

About 400 lines of plain JavaScript. Read it before you run it.