Purge
Delete many messages at once, with filters for exactly which ones.
#Overview
Purge deletes recent messages in the channel you run it in. You can clear everything, or pick which ones go: one person's messages, bot messages, links, images, messages with a certain word, and more. You can also take reactions off messages without deleting them.
#Getting started
Go to the channel. Purge works on the channel you type it in.
Pick what to clear.
/purge allwith a number clears that many messages. Any other filter clears the last 100 that match if you don't give a number.Run it. Utilities shows "Purging messages..." while it works, then says how many it purged. That line removes itself a second later. If you used the prefix, your command message is deleted too.
/purge all 50 /purge user @someone /purge bots
With the prefix, a number on its own clears that many, and a name or mention clears that person's messages:
,purge 50 ,p 50 ,p @someone 20
#Filters
Every filter takes an amount from 1 to 500. Leave it out and it clears up to 100.
| Command | What it deletes |
|---|---|
all | Every message. The amount is required here. |
user | One person's messages. |
self | Your own messages. |
except | Everyone's messages except one person's. |
bots | Bot messages and the commands that caused them. See below. |
humans | Messages sent by people. Bots, webhooks and Discord's own messages are left alone. |
webhooks | Messages sent by webhooks. |
embeds | Messages with an embed. |
files | Messages with a file attached. |
images | Messages with an image. |
links | Messages with a link (anything starting with http://, https:// or www.). |
invites | Messages with a Discord invite. |
mentions | Messages that mention a person, a role, @everyone or @here. |
emojis | Messages with an emoji. |
stickers | Messages with a sticker. |
voice | Voice messages. |
system | Messages sent by Discord, like joins and pins. |
contains | Messages that contain a word. |
startswith | Messages that start with a word. |
endswith | Messages that end with a word. |
before | Messages sent before a message. |
after | Messages sent after a message. |
between | Messages sent between two messages. |
reactions | Reactions on recent messages. The messages stay. |
#Words
contains, startswith and endswith ignore capital letters, so hello also matches Hello. With the prefix, everything after the command is the text to match, so ,purge contains hello there looks for "hello there" and clears up to 100. Use the slash command if you want to set an amount.
#Before, after and between
These take a message link or a message ID. Right-click a message and copy either one. For between, the two messages can be given in any order. The messages have to be in the channel you run the command in.
/purge after https://discord.com/channels/123/456/789 /purge between 1234567890123456789 1234567890987654321
#Bots
/purge bots (or ,pb) clears up after bots in one go. It takes:
- every message sent by a bot,
- every message a bot replied to,
- every message that looks like a bot command: one that starts with
,!?.$%+;&/or your server's own prefix, followed straight away by a short word.
It also clears the channel's snipes, so the bot spam can't be read back with /snipe. Other purges leave snipes alone.
#Reactions
/purge reactions takes the reactions off recent messages that have any. The amount is how many messages to clear, up to 100. Unlike deleting, this works on messages of any age.
#Good to know
- Permissions. You need Manage Messages. Utilities needs Manage Messages and Read Message History in the channel.
- 500 at most. One purge deletes up to 500 messages.
- 14 days. Discord doesn't let bots bulk-delete messages older than 14 days, so those are skipped. The reply tells you how many were actually deleted, which can be fewer than you asked for.
- How far back it looks. A filtered purge looks through up to 5,000 recent messages to find matches.
- One at a time. If you run two purges in the same channel, the second one waits for the first to finish.
- Snipe. Purged messages still show up in snipe, except the ones
purge botstakes.
#Commands
/purge all (amount)Manage MessagesPurge messages Also: ,purge p
/purge user (user)Manage MessagesPurge a specific user's messages Also: ,purge pu
/purge selfManage MessagesPurge your own messages Also: ,purge ps
/purge except (user)Manage MessagesPurge everybody's messages but one person's
/purge botsManage MessagesPurge bot messages and the commands that caused them Also: ,purge bot ,purge pb
/purge humansManage MessagesPurge messages sent by people Also: ,purge human ,purge ph
/purge webhooksManage MessagesPurge messages sent by webhooks Also: ,purge webhook
/purge embedsManage MessagesPurge messages containing an embed Also: ,purge embed ,purge pe
/purge filesManage MessagesPurge messages containing a file Also: ,purge file
/purge imagesManage MessagesPurge messages containing an image Also: ,purge image ,purge pi
/purge linksManage MessagesPurge messages containing a link Also: ,purge link ,purge pl
/purge invitesManage MessagesPurge messages containing an invite Also: ,purge invite
/purge mentionsManage MessagesPurge messages containing a mention Also: ,purge mention
/purge emojisManage MessagesPurge messages containing an emoji Also: ,purge emoji
/purge stickersManage MessagesPurge messages containing a sticker Also: ,purge sticker
/purge voiceManage MessagesPurge voice messages
/purge systemManage MessagesPurge messages sent by Discord, like joins and pins
/purge contains (query)Manage MessagesPurge messages containing a word
/purge startswith (query)Manage MessagesPurge messages starting with a word
/purge endswith (query)Manage MessagesPurge messages ending with a word
/purge before (message)Manage MessagesPurge messages sent before a message
/purge after (message)Manage MessagesPurge messages sent after a message
/purge between (start) (finish)Manage MessagesPurge messages sent between two messages
/purge reactionsManage MessagesPurge reactions from recent messages Also: ,purge reaction