Skip to content

Bulk Message Deletion on Discord: The /clear Command and Limits

Delete recent messages with a single command, filter by a specific user, and learn why the 14-day rule skips some messages. Permissions, logs, pinned messages, and the meaning of "0 messages deleted."

VeyroBot team

This article was translated automatically from the Turkish original. Read the Turkish original

Bulk Message Deletion on Discord: The /clear Command and Limits
In this article
  1. Module, permissions on both sides, and the log channel
  2. Step 1: Delete recent messages
  3. Step 2: Delete messages from a single user
  4. The 14-day rule: why are some messages not deleted?
  5. Where is the cleanup recorded?
  6. If messages were not deleted or too many were deleted
  7. Is it suitable for emptying a channel from start to finish?
  8. Frequently asked questions

In short

Bulk message deletion in VeyroBot is performed with the /clear command: /clear amount:50 deletes the last 50 messages in the channel where you type it. The optional target option limits the deletion to messages from a single user. A maximum of 100 messages can be deleted at once, messages older than 14 days are skipped, and every cleanup is recorded as a numbered case.

The command response is visible only to you. Members in the channel will only notice the cleanup when the messages disappear.

Module, permissions on both sides, and the log channel

  • The Moderation module must be enabled. If the Moderation & Punishment switch on the Overview screen of the dashboard is off, /clear will not work. The bot will respond: "The /clear command is linked to the Moderation & Punishment module, and this module is disabled on your server."
  • You must have the Manage Messages permission. Discord only shows the command to members with this permission by default. If you lack the permission, the response is: "You must have the Manage Messages permission to use this command."
  • The bot must also have permission. VeyroBot must be able to see the channel, read message history, and have the Manage Messages permission in that channel. A channel-level denial overrides role-based permissions.
  • A log channel must be selected. For the cleanup to be recorded in the moderation log channel, the module must be enabled in the Audit Logs tab, and a Moderation Log Channel must be selected. If no channel is selected, the case is still recorded, but the log message will not be sent.

This topic in VeyroBot:Discord Moderation Bot →

Step 1: Delete recent messages

Type /clear amount:30. amount is mandatory and must be between 1 and 100; Discord does not accept numbers outside this range. The command retrieves and deletes the last 30 messages in the channel where you typed it. It does not matter who wrote them; bot messages are included as well.

The response is visible only to you: "Successfully deleted 30 messages." The number here is the actual number of messages deleted. If it is smaller than you requested, the reason is usually the 14-day rule mentioned below. To delete more than 100 messages, run the command again; each execution opens a separate case.

Step 2: Delete messages from a single user

/clear amount:50 target:@user deletes only that user's messages. Important detail: the bot first retrieves the last 50 messages in the channel, then deletes those belonging to that user from that batch. In other words, it does not delete the user's last 50 messages, but rather the messages from that user found within the channel's last 50 messages. If the user hasn't posted much recently, the deleted count will be low; increase the amount value to 100 if necessary.

You can also select a bot in the target option; in this case, only that bot's messages will be deleted.

/clear only works in the channel where you type the command, and there is no option to select a different channel. To clear messages from a spamming account across multiple channels while banning them, use the delete_messages option of the /ban command; this deletes the person's messages from the last 1 hour, 24 hours, or 7 days. The choice between a ban and a timeout is explained in the temporary ban and timeout guide.

The 14-day rule: why are some messages not deleted?

Discord does not allow bulk deletion of messages older than 14 days. Instead of trying to delete these messages and returning an error, VeyroBot filters them out beforehand. For example, if 20 of the last 50 messages are older than 14 days, only 30 will be deleted, and the response will say 30. If all messages are older than 14 days, the response will be "Successfully deleted 0 messages."

These messages can only be deleted one by one; there is no command for this in VeyroBot.

Where is the cleanup recorded?

Case recordEvery /clear opens a numbered case and records how many messages were deleted in which channel. If you provided a target, the case is opened in that user's name and appears in the /case-history list.
Moderation log channelIf Audit Logs are enabled and a Moderation Log Channel is selected, the case number, the moderator who performed the action, and the number of deleted messages will be sent there.
Message log channelIf a Message Edit & Delete Log Channel is selected, the bulk deletion will appear there as a single record titled "Messages Bulk Deleted," including the channel and count. The content of the deleted messages is not included in this record. If the cleaned channel is in the Ignored in Message Logs list, this record is skipped.

How log channels work in conjunction with the alert system is explained in the log channel and alert system guide.

If messages were not deleted or too many were deleted

  • Mistaking the parenthesis in the error message for the cause. If deletion fails, the response is in the format: "Messages could not be deleted (messages older than 14 days cannot be bulk deleted by Discord): …" The note in the parentheses appears in every error. Since old messages are already filtered out, the actual reason is the Discord error text following the colon. If you see Missing Permissions there, the bot does not have the necessary permission in that channel.
  • Assuming pinned messages are safe. /clear does not distinguish pinned messages; if they are among the recent messages, they will be deleted. Start with a small number in channels where pinned messages are important.
  • Mistaking the "0 messages deleted" response for a malfunction. There are three possible reasons: all selected messages are older than 14 days, the user you specified in target has no messages among the recent ones, or the bot lacks permission to read message history in the channel.
  • Running it in the wrong channel. The command always cleans the channel where you type it. Switch to the channel you want to clean and type the command there.

Is it suitable for emptying a channel from start to finish?

Suitable for: moderators who need to quickly clean up a channel after spam, flood, or a prolonged argument; teams that want to keep a record of who deleted how many messages.

Not suitable for: those who want to empty a channel entirely or delete history stretching back weeks. The 100-message and 14-day limit per command are not suitable for this purpose. To prevent spam from recurring, set up AutoMod filters after cleaning.

Frequently asked questions

Can I delete more than 100 messages at once?

No. The amount is capped at 100. For more, run the command again; each execution is recorded as a separate case.

Do members in the channel see the cleanup?

The command response is visible only to you, and no bot message is posted in the channel. The cleanup is only recorded in the selected log channels.

Can I recover deleted messages?

No. Deleted messages cannot be recovered. The bulk deletion record in the message log channel also contains only the channel and count, not the content.

Is a case opened even if no messages are deleted?

Yes. If the command completes without error, a case is opened even if the deleted count is 0, and the reason will state 0.

For a general introduction to moderation tools, see the Discord moderation bot page; for all settings, refer to the moderation and audit logs documentation; and for command details, check the clear, ban, and vaka-gecmisi cards.

Last updated: September 26, 2026. The limits, 14-day behavior, permissions, and log records in this article have been verified against the current version of VeyroBot's /clear command, case logging, and log sender.

Add the bot to your server Free · ~30s