Discord — Bulk Message Deleter

Delete all your Discord messages in any channel, an entire server, or all DMs. Fully automatic speed — reads Discord's own rate-limit headers to run at maximum safe throughput with zero 429s.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Advertisement:

Аўтар
RuggedJar
Усталяванняў за дзень
2
Усяго ўсталяванняў
158
Рэйтынг
0 0 0
Версія
2.0.0
Створаны
11.04.2026
Абноўлены
11.04.2026
Памер
41.6 КБ
Ліцэнзія
MIT
Ужываецца на

🗑 Discord Cleaner

A Tampermonkey userscript that bulk-deletes your Discord messages from a single channel, an entire server, or all your DMs — with a clean in-page UI, automatic credential detection, and fully automatic speed control.

Version License Platform


⚠️ Disclaimer

Automating a user account (self-botting) violates Discord's Terms of Service. Your account may be flagged or banned. This tool is intended solely for personal data cleanup. Use at your own risk.


✨ Features

Feature Detail
Automatic speed control Reads Discord's X-RateLimit-Remaining and X-RateLimit-Reset-After headers on every response and self-tunes to the fastest safe speed — no manual slider, no 429 spam
Three scope modes Single channel · Entire server · All DMs
Token auto-detection Intercepts Discord's own network requests at page load — token and user ID fill in automatically when you click any channel
History API Pages through 100 messages at a time with a snowflake cursor — no search index lag, nothing missed
Live metrics Real-time msgs/min and current delay shown in the panel
Date range filters Delete only messages before and/or after a specific date
Keyword filter Only delete messages containing a specific word or phrase
Pause / Resume / Stop Full run control at any time
Draggable, resizable panel Snaps to top-right, drag anywhere, resize to taste
SPA-aware Auto-updates channel/server IDs as you navigate Discord

📦 Installation

1. Install Tampermonkey

Browser Link
Chrome Install
Firefox Install
Edge Install

2. Install the script

Option A — GreasyFork (one click):

(link coming soon)

Option B — Manual:

  1. Open Tampermonkey → Dashboard → + (New Script tab)
  2. Select all the default content and delete it
  3. Paste the full contents of discord-delete-messages.user.js
  4. Ctrl+S to save

3. Open Discord in your browser

Go to discord.com/app — not the desktop app. The script does not run inside the Electron wrapper.


🚀 Usage

  1. Open Discord in your browser and hard-refresh (Ctrl+Shift+R) after installing
  2. A red 🗑 button appears in the bottom-right corner — click it to open the panel
  3. Click any channel or DM in Discord — token and User ID fill in automatically within one second
  4. The credential dot turns green: Token + User ID ready
  5. Pick your Scope tab: Channel / Server / All DMs
  6. Click 📍 Fill IDs from current URL to populate the channel/server fields
  7. Optionally set date or keyword filters
  8. Click ▶ Start

If the User ID doesn't auto-fill after clicking a channel, click the Fetch ID button — it calls /users/@me directly to resolve it.


⚙️ How auto-pacing works

Discord includes these headers on every API response:

X-RateLimit-Remaining:   4
X-RateLimit-Reset-After: 0.974

After every delete, the script reads these and calculates:

ideal_delay = (reset_after_ms / remaining) × 1.15

This spreads the remaining quota evenly across the reset window with a 15 % safety margin. When the bucket drains (remaining = 0), it waits the exact reset time before continuing. The result is maximum throughput with no 429s under normal conditions.

If a 429 does occur (e.g. during a global rate limit), the script reads retry_after from the response body and waits the exact duration before retrying.


🎛 Scope modes

Mode How it works
Channel Deletes your messages in the currently selected channel or DM
Server Fetches all text channels (types 0, 5, 10, 11, 12) and scans each one in order
All DMs Fetches your full DM list and deletes your messages in each conversation

🔧 Config block

Tunable constants are at the top of the script:

const CFG = {
  pageSizeFetch:  100,   // history messages per page (Discord max = 100)
  pageDelayMs:    600,   // ms between history-page fetches
  minDeleteMs:    300,   // floor on auto-computed delete delay
  maxDeleteMs:   8000,   // ceiling on delete delay (extreme backoff cap)
  emptyPageLimit:   3,   // consecutive empty pages → channel complete
  speedSamples:    20,   // rolling window size for msgs/min display
};

🔧 Troubleshooting

Token not auto-detecting?

  • Make sure you hard-refreshed Discord after saving the script in Tampermonkey (@run-at document-start must fire before Discord's JS loads)
  • Try clicking several different channels and DMs to generate API traffic

User ID not filling?

  • Click Fetch ID — this calls /users/@me directly using the captured token

"No read access" errors?

  • Expected in channels where you don't have read-history permission (e.g. private channels you were removed from)
  • The script logs the warning and skips automatically

Script stops mid-run?

  • Check the log for any ✗ Failed entries with HTTP error codes
  • A single failure doesn't stop the run — only Stop/Pause/error does

🛡 Security & privacy

  • Your token is never sent to any server other than Discord
  • No analytics, no telemetry, no external requests of any kind
  • The entire script is one self-contained file — audit it yourself before running
  • All processing is local in your browser

Never share your auth token. It grants full access to your account. If you accidentally expose it, log out of Discord immediately (invalidates the token) and change your password.


🤝 Contributing

PRs and issues are welcome.

  1. Fork the repo
  2. Edit discord-delete-messages.user.js
  3. Test on discord.com/app in Chrome + Firefox
  4. Open a PR with a clear description of the change

Please open an issue first for large changes so we can align before you invest time.


📄 License

MIT — © 2026 discord-cleaner contributors