Discord error 50016: Too few or too many messages to bulk delete
Last verified against Discord Developer Docs - Opcodes and status codes
Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to deleteWhat error 50016 means
The messages array you sent to POST /channels/{channel.id}/messages/bulk-delete had the wrong length. Bulk delete exists for batches; a single message must be deleted with DELETE /channels/{channel.id}/messages/{message.id}, and very large sets must be split.
The literal message says "fewer than 100", while the endpoint reference describes a range of 2 to 100 message IDs. Sending batches of at most 100 and switching to single delete when only one ID remains satisfies both readings.
The most common trigger is a /purge 1 command, or a purge whose filter (for example "only messages from this user") narrows a batch down to one or zero messages. Duplicate IDs in the array can also cause trouble, so de-duplicate first. Messages older than 14 days fail separately with 50034.
What it looks like
{
"message": "Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to delete",
"code": 50016
}Why it happens
- Purge command called with a count of 1
- Filter left only one (or zero) messages in the batch
- Batch larger than 100 IDs
- Duplicate IDs in the array
How to fix Discord error 50016
- 1De-duplicate the ID list and drop messages older than 14 days
- 2If 0 IDs remain, do nothing; if 1, use the single-message DELETE route
- 3Split larger lists into chunks of at most 100 and send each chunk
- 4Report the number actually deleted back to the moderator
- 5Log the size of each batch you send so off-by-one errors show up
How to stop it recurring
Put the branching (0, 1, 2 to 100, more) inside one helper used by every purge feature. Combine it with the age filter so bulk delete only ever receives eligible IDs. Bulk-delete limits are on the Discord limits page.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
Error 50016 - quick answers
What does Discord error 50016 mean?
The messages array you sent to POST /channels/{channel.id}/messages/bulk-delete had the wrong length. Bulk delete exists for batches; a single message must be deleted with DELETE /channels/{channel.id}/messages/{message.id} , and very large sets must be split. The literal message says "fewer than 100", while the endpoint reference describes a range of 2 to 100 message IDs.
How do I fix Discord error 50016?
1. De-duplicate the ID list and drop messages older than 14 days 2. If 0 IDs remain, do nothing; if 1, use the single-message DELETE route 3. Split larger lists into chunks of at most 100 and send each chunk 4. Report the number actually deleted back to the moderator 5. Log the size of each batch you send so off-by-one errors show up
Should I retry after error 50016?
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.