> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bloombot.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Purging messages

> Clear messages in bulk: by count, by author, by content, between two points, or across every channel at once.

`purge` deletes messages from the channel you run it in. On its own it clears a number of recent messages, and with a filter it clears only the ones that match, such as messages from one member or messages containing a link.

<Warning>
  Deleted messages are gone. Discord provides no way to recover them, and neither does Bloom. If the messages are evidence, capture them first with a transcript or screenshots.
</Warning>

## Clearing recent messages

<ParamField path="purge <amount>" type="Manage Messages">
  Deletes the most recent messages in the channel. Aliases: `clear`, `delete`, `c`, `p`.

  * **Bloom needs:** Manage Messages and Read Message History.
  * Up to **300** messages at a time.
  * `!purge 50` clears the last fifty messages and confirms with a message that removes itself a moment later.
</ParamField>

Bloom deletes your command as it starts, so the command itself never counts toward the total or survives the clear.

<Info>
  Discord only allows messages under **14 days old** to be deleted in bulk. A plain `!purge` still removes older messages, one at a time, which is noticeably slower. The filters below skip anything older than 14 days instead.
</Info>

## Clearing only some messages

Each filter looks at the most recent messages in the channel, up to **100**, and deletes the ones that match. The number you give is how many messages Bloom **checks**, not how many it deletes, so `!purge links 100` scans the last hundred messages and may delete only three.

| Command                          | Deletes                                |
| -------------------------------- | -------------------------------------- |
| `purge user <user> <amount>`     | Messages from one member               |
| `purge bots <amount>`            | Messages from bots                     |
| `purge links <amount>`           | Messages containing a URL              |
| `purge invites <amount>`         | Messages containing a Discord invite   |
| `purge attachments <amount>`     | Messages with a file or image attached |
| `purge mentions <amount>`        | Messages that mention someone          |
| `purge contains <text> <amount>` | Messages containing the text you name  |

<ParamField path="purge contains <text> <amount>" type="Manage Messages">
  Deletes messages containing a word or phrase. Wrap a phrase in quotes to match it as a whole.

  * `!purge contains scam 100` removes messages containing "scam".
  * `!purge contains "free nitro" 200` matches the full phrase.
</ParamField>

<ParamField path="purge user <user> <amount>" type="Manage Messages">
  Deletes one member's messages from this channel. Takes a mention, an ID, or a name.

  * `!purge user @Someone 50` checks the last fifty messages and removes theirs.
</ParamField>

## Clearing a range

<ParamField path="purge between <message_id> <message_id>" type="Manage Messages">
  Deletes everything between two messages, which is the tool for cleaning up one argument without touching the conversation around it.

  * Takes two **message IDs**. Order does not matter.
  * Covers up to **1000** messages.
</ParamField>

<ParamField path="purge after <message_id>" type="Manage Messages">
  Deletes every message posted after the one you name, up to **5000** messages. Bloom tells you what it is scanning as it works.

  * Message IDs are 17 to 19 digits. Bloom checks the message is in this channel before starting.
</ParamField>

<Tip>
  To get a message ID, turn on Developer Mode in Discord's settings under **Advanced**, then right click a message and choose **Copy Message ID**.
</Tip>

<Danger>
  `purge after` can remove thousands of messages from a single command, and there is no confirmation step. Check you have the right message ID before running it.
</Danger>

## Clearing reactions instead of messages

<ParamField path="purge reactions <amount>" type="Manage Messages">
  Removes **all reactions** from recent messages and leaves the messages themselves alone. Checks up to 100 messages.

  * Use it after a reaction spam run, when the messages are fine but the reactions are not.
</ParamField>

## Clearing one member across the server

<ParamField path="globalpurge <user> [time]" type="Manage Messages">
  Deletes a member's recent messages from every channel Bloom can reach, rather than one channel. Alias: `gp`.

  * Checks the most recent messages in each text channel and thread, so it is built for a spam run that just happened rather than a full history wipe.
  * Without a time it covers the last **2 weeks**, which is also the maximum.
  * `!globalpurge @Someone 2h` clears their messages from the last two hours everywhere.
  * Channels where Bloom lacks View Channel, Manage Messages, or Read Message History are skipped.
</ParamField>

<Warning>
  A global purge deletes across every channel at once, including channels you may not have looked at. Prefer `!purge user` in the affected channel when the mess is contained to one place.
</Warning>

## Clearing your own messages

<ParamField path="selfpurge <amount>" type="Manage Messages">
  Deletes your own recent messages in this channel and nobody else's. Alias: `spurge`.

  * Up to **100** at a time.
  * Useful for clearing your own command output without touching the conversation.
</ParamField>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Cannot delete messages older than 14 days">
    Discord's bulk deletion only reaches back 14 days. Use a plain `!purge <amount>`, which falls back to deleting older messages individually, or delete them by hand.
  </Accordion>

  <Accordion title="Purge deleted fewer messages than I asked for">
    With a filter, the number is how many messages Bloom checks, not how many match. It also skips messages older than 14 days, and stops early if the channel does not have that many messages.
  </Accordion>

  <Accordion title="Nothing happened and Bloom said nothing">
    Bloom needs Manage Messages and Read Message History in that specific channel. A channel override can deny either one while the server wide permission looks fine.
  </Accordion>

  <Accordion title="Could not find that message in this channel">
    `purge between` and `purge after` only accept IDs of messages in the channel you are running the command in. Copying an ID from another channel fails this check.
  </Accordion>

  <Accordion title="The confirmation message disappeared">
    That is deliberate. Bloom removes its own confirmation a few seconds later so the cleared channel stays clear.
  </Accordion>
</AccordionGroup>

## Related pages

<CardGroup cols={2}>
  <Card title="Event logging" icon="rectangle-list" href="/configuration/logging">
    Log deleted messages so a purge does not erase the record too.
  </Card>

  <Card title="Bans, kicks, and timeouts" icon="gavel" href="/moderation/punishments">
    Ban commands can clear a member's recent messages as they go.
  </Card>

  <Card title="Warnings, cases, and staff records" icon="clipboard-list" href="/moderation/cases">
    Record why the cleanup happened.
  </Card>

  <Card title="Permissions and hierarchy" icon="user-lock" href="/getting-started/permissions">
    Why a command can work in one channel and not another.
  </Card>
</CardGroup>
