You are trying to bulk delete messages in a Discord channel but see the error code 50034. This error appears when you select messages that are more than two weeks old. Discord’s API blocks bulk deletion of messages older than 14 days to prevent abuse and data loss. This article explains why the error occurs and provides three working methods to remove old messages.
Key Takeaways: How to Remove Old Messages Despite Error 50034
- Discord API restriction on messages older than 14 days: Bulk delete commands and right-click delete fail for messages beyond this limit.
- Manual deletion of individual messages: Only messages younger than two weeks can be bulk deleted; older ones must be removed one by one or via bots with proper permissions.
- Using a bot like MEE6 or Dyno: Bots with the Manage Messages permission can purge old messages using commands such as
!clearor?purge.
Why Discord Error 50034 Occurs When Bulk Deleting Messages
Discord enforces a two-week limit on bulk message deletion. This restriction applies to the built-in bulk delete feature available via right-click or the /clear slash command. When you select messages older than 14 days, the API returns error 50034 with the message “Cannot bulk delete messages older than two weeks.” This limit exists to protect server history and prevent mass data removal by malicious actors. The restriction applies to all users, including server owners and administrators, unless you use a bot that bypasses the limit through a different API endpoint.
Technical Root Cause
The bulk delete endpoint /channels/{channel.id}/messages/bulk-delete only accepts message IDs that are less than 14 days old. Discord’s API documentation confirms this limitation. Any request containing a message ID older than 14 days returns a 50034 error. This is not a bug — it is a deliberate design choice to prevent data loss and comply with data retention policies.
What the Error Message Means
When you see “Cannot bulk delete messages older than two weeks,” the action stops immediately. No messages are deleted. The error appears in a red banner at the top of the Discord client. You cannot bypass this by deleting fewer messages — the restriction applies to any message older than 14 days, regardless of the total selection size.
Steps to Fix Error 50034 and Delete Old Messages
There are three reliable methods to remove messages older than two weeks. Choose the one that fits your needs and permissions.
Method 1: Delete Messages Individually
- Open the channel containing the old messages
Navigate to the text channel where you want to remove messages. - Right-click the message you want to delete
A context menu appears. Select Delete Message from the list. - Confirm the deletion
Click Delete in the confirmation dialog. The message is removed immediately. - Repeat for each message
This method works for any message regardless of age. Use it for a small number of old messages.
Method 2: Use a Bot with Purge Command
- Invite a bot that supports message purging
Popular options include MEE6, Dyno, and Carl-bot. Visit the bot’s website and authorize it for your server. Ensure the bot has the Manage Messages permission. - Navigate to the channel with old messages
Go to the text channel you want to clean. - Type the purge command in the chat
For MEE6, use!clear 100to delete the last 100 messages. For Dyno, use?purge 100. Replace “100” with the number of messages you want to remove. - Confirm the action
The bot will ask for confirmation in a reply. Click the checkmark or typeyesto proceed. The bot deletes all messages, including those older than two weeks.
Method 3: Use the API with a Custom Script
- Create a Discord bot application
Go to the Discord Developer Portal, create a new application, and add a bot user. Copy the bot token. - Write a script using a programming language
Use Python with thediscord.pylibrary. Example code:await channel.purge(limit=100, before=discord.Object(id=message_id)). This deletes messages older than a specific ID. - Run the script with proper permissions
The bot must have Manage Messages permission in the target channel. Execute the script from your terminal or IDE. The bot will delete all matching messages.
If Discord Still Shows Error 50034 After Trying the Main Fixes
Bot Does Not Delete Messages Older Than Two Weeks
Some bots also respect the two-week limit. Check the bot’s documentation. Bots like MEE6 and Dyno use the bulk delete endpoint by default, which blocks old messages. To bypass this, use a bot that supports the purge command with the --force flag or a custom script that deletes messages individually using the bot’s token.
Error 50034 Appears Even for Recent Messages
This happens when you select a mix of recent and old messages. The error triggers if any single message in the selection is older than 14 days. To avoid this, use the date filter in the channel search. Type before:2023-01-01 to find only messages older than a specific date, then delete them individually or with a bot that ignores the limit.
Bot Cannot Delete Messages in a Server Without Proper Roles
The bot must have the Manage Messages permission. Check the server settings under Server Settings > Roles > [Bot Role] > Permissions. Enable Manage Messages and Read Message History. Also ensure the bot role is placed above the roles of the users whose messages you want to delete in the role hierarchy.
| Item | Manual Deletion | Bot Purge Command |
|---|---|---|
| Time required for 50 messages | 5-10 minutes | 30 seconds |
| Works on messages older than 14 days | Yes | Yes (with bots that bypass limit) |
| Requires Manage Messages permission | No | Yes |
| Risk of hitting rate limits | Low | Moderate |
You now have three ways to remove old messages despite Discord error 50034. For a one-time cleanup of a few messages, use manual deletion. For large channels, invite a bot like MEE6 and use the purge command. For full control, write a custom script that deletes messages individually. Remember that Discord’s two-week limit is intentional — always test your approach on a few messages before running a full purge.