How do I ban someone who has already left the server (/ban with an ID)?

CommandsBanID

A troublemaker leaves the server before you had time to react? /ban accepts an account ID instead of a member, and bans even if they are no longer there.

Get the ID

  1. Turn on developer mode in Discord User Settings › Advanced › Developer Mode.
  2. Right-click their name or photo, in an old message
  3. Click “Copy User ID”

Ban with the ID

  1. Type /ban
  2. Leave utilisateur empty and paste the ID in id
  3. Add a raison then confirm

Possible error messages

MessageCause
Specify a user or an IDYou filled in neither utilisateur nor id.
Invalid ID (17 to 20 digits)The ID was copied wrongly (letters, spaces, too short).
This user is already bannedNothing to do, they already are.
You can’t moderate yourselfIt is your own ID.
Unable to moderate this userThey are still on the server and their role is above or equal to the bot’s. See troubleshooting.
If you fill in both The member mention takes priority over the ID.

Still stuck?

Contact support with the title of this article, the step where you are stuck and what you see on screen.

Contact support More articles: Moderation

Last checked: 13 November 2026.