Discord error 50034: Message too old to bulk delete
Last verified against Discord Developer Docs - Opcodes and status codes
A message provided was too old to bulk deleteWhat error 50034 means
Bulk Delete Messages (POST /channels/{id}/messages/bulk-delete) only accepts messages younger than 14 days. If any ID in the messages array belongs to a message older than two weeks, Discord rejects the whole request with 50034; it does not partially apply. The endpoint also requires between 2 and 100 IDs and no duplicates, but those violations produce different errors.
Purge and cleanup commands hit this when they fetch the last N messages and pass them straight to bulk delete without checking age. In a quiet channel, the last 100 messages can easily span months. Message age is encoded in the snowflake, so you can compute it offline: (id >> 22) + 1420070400000 gives the Unix milliseconds timestamp.
What it looks like
{
"message": "A message provided was too old to bulk delete",
"code": 50034
}Why it happens
- Purge command passed messages older than 14 days in the bulk array
- Channel with low traffic where recent N messages include very old ones
- Scheduled cleanup that runs less often than every two weeks
- Clock skew or off-by-one in your own age filter (the limit is strict)
How to fix Discord error 50034
- 1Filter the IDs by age before calling bulk delete; keep only those newer than 14 days minus a safety margin
- 2Delete the older ones individually with DELETE /channels/{id}/messages/{id}, respecting rate limits
- 3Compute age from the snowflake rather than from a stored timestamp to avoid drift
- 4Most libraries do this filtering for you (for example discord.js bulkDelete with filterOld=true); enable it
How to stop it recurring
Split every purge into two paths by age: bulk for the recent set, sequential for the rest, with a progress message because the sequential path is slow. Schedule recurring cleanups more often than every 14 days so bulk delete remains applicable.
The 14-day boundary is enforced against the snowflake timestamp, so a correct local filter eliminates the error entirely rather than merely reducing it. Bulk-delete bounds (2-100 IDs, no duplicates) are on the Discord limits page; individual deletes of the older remainder are subject to normal buckets, so pace them per http 429.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
Error 50034 - quick answers
What does Discord error 50034 mean?
Bulk Delete Messages (POST /channels/{id}/messages/bulk-delete) only accepts messages younger than 14 days. If any ID in the messages array belongs to a message older than two weeks, Discord rejects the whole request with 50034; it does not partially apply. The endpoint also requires between 2 and 100 IDs and no duplicates, but those violations produce different errors.
How do I fix Discord error 50034?
1. Filter the IDs by age before calling bulk delete; keep only those newer than 14 days minus a safety margin 2. Delete the older ones individually with DELETE /channels/{id}/messages/{id}, respecting rate limits 3. Compute age from the snowflake rather than from a stored timestamp to avoid drift 4. Most libraries do this filtering for you (for example discord.js bulkDelete with filterOld=true); enable it
Should I retry after error 50034?
No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.
Stop debugging Discord by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.