UtilitiesDocs

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

  1. Go to the channel. Purge works on the channel you type it in.

  2. Pick what to clear. /purge all with a number clears that many messages. Any other filter clears the last 100 that match if you don't give a number.

  3. 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.

CommandWhat it deletes
allEvery message. The amount is required here.
userOne person's messages.
selfYour own messages.
exceptEveryone's messages except one person's.
botsBot messages and the commands that caused them. See below.
humansMessages sent by people. Bots, webhooks and Discord's own messages are left alone.
webhooksMessages sent by webhooks.
embedsMessages with an embed.
filesMessages with a file attached.
imagesMessages with an image.
linksMessages with a link (anything starting with http://, https:// or www.).
invitesMessages with a Discord invite.
mentionsMessages that mention a person, a role, @everyone or @here.
emojisMessages with an emoji.
stickersMessages with a sticker.
voiceVoice messages.
systemMessages sent by Discord, like joins and pins.
containsMessages that contain a word.
startswithMessages that start with a word.
endswithMessages that end with a word.
beforeMessages sent before a message.
afterMessages sent after a message.
betweenMessages sent between two messages.
reactionsReactions 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 bots takes.

#Commands

/purge all (amount)Manage Messages

Purge messages Also: ,purge p

/purge user (user)Manage Messages

Purge a specific user's messages Also: ,purge pu

/purge selfManage Messages

Purge your own messages Also: ,purge ps

/purge except (user)Manage Messages

Purge everybody's messages but one person's

/purge botsManage Messages

Purge bot messages and the commands that caused them Also: ,purge bot ,purge pb

/purge humansManage Messages

Purge messages sent by people Also: ,purge human ,purge ph

/purge webhooksManage Messages

Purge messages sent by webhooks Also: ,purge webhook

/purge embedsManage Messages

Purge messages containing an embed Also: ,purge embed ,purge pe

/purge filesManage Messages

Purge messages containing a file Also: ,purge file

/purge imagesManage Messages

Purge messages containing an image Also: ,purge image ,purge pi

/purge linksManage Messages

Purge messages containing a link Also: ,purge link ,purge pl

/purge invitesManage Messages

Purge messages containing an invite Also: ,purge invite

/purge mentionsManage Messages

Purge messages containing a mention Also: ,purge mention

/purge emojisManage Messages

Purge messages containing an emoji Also: ,purge emoji

/purge stickersManage Messages

Purge messages containing a sticker Also: ,purge sticker

/purge voiceManage Messages

Purge voice messages

/purge systemManage Messages

Purge messages sent by Discord, like joins and pins

/purge contains (query)Manage Messages

Purge messages containing a word

/purge startswith (query)Manage Messages

Purge messages starting with a word

/purge endswith (query)Manage Messages

Purge messages ending with a word

/purge before (message)Manage Messages

Purge messages sent before a message

/purge after (message)Manage Messages

Purge messages sent after a message

/purge between (start) (finish)Manage Messages

Purge messages sent between two messages

/purge reactionsManage Messages

Purge reactions from recent messages Also: ,purge reaction