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.
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.
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.
| 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 |
| Browser | Link |
|---|---|
| Chrome | Install |
| Firefox | Install |
| Edge | Install |
Option A — GreasyFork (one click):
(link coming soon)
Option B — Manual:
discord-delete-messages.user.jsGo to discord.com/app — not the desktop app. The script does not run inside the Electron wrapper.
If the User ID doesn't auto-fill after clicking a channel, click the Fetch ID button — it calls
/users/@medirectly to resolve it.
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.
| 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 |
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
};
Token not auto-detecting?
@run-at document-start must fire before Discord's JS loads)User ID not filling?
/users/@me directly using the captured token"No read access" errors?
Script stops mid-run?
✗ Failed entries with HTTP error codesNever 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.
PRs and issues are welcome.
discord-delete-messages.user.jsdiscord.com/app in Chrome + FirefoxPlease open an issue first for large changes so we can align before you invest time.
MIT — © 2026 discord-cleaner contributors