Discord API · error code

Discord error 20031: Disallowed words in names

Policy / accountHTTP 400AutoMod and content filters

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Your Stage topic, server name, server description, or channel names contain words that are not allowed

What error 20031 means

The name or text field you tried to set contains a word Discord does not allow in that field. The literal message names the fields this applies to: Stage topics, server names, server descriptions and channel names. It is Discord's own word filter, separate from any AutoMod rules the server configured.

Bots hit it when they build names from user input: ticket bots naming channels after the user, voice-channel generators that use a member's activity or nickname, or a /rename command that passes text straight through to PATCH /channels/{channel.id} or PATCH /guilds/{guild.id}.

Discord does not publish the word list, so do not attempt to reverse-engineer it. Treat 20031 as a user-facing validation failure: the request was well formed and the bot had permission, but the chosen text is not accepted.

What it looks like

{
  "message": "Your Stage topic, server name, server description, or channel names contain words that are not allowed",
  "code": 20031
}

Why it happens

  • Channel name generated from a username or nickname that contains a disallowed word
  • Stage topic set from user-supplied text
  • Server name or description updated by an admin command with filtered words
  • Template-based channel naming that concatenates user input

How to fix Discord error 20031

  1. 1Catch 20031 on name updates and ask the user to choose different text
  2. 2Fall back to a neutral generated name (for example ticket-1234) when user-derived names are rejected
  3. 3Log the rejected text for moderators, without echoing it back into the server
  4. 4Retry with the fallback name and confirm the channel is created

How to stop it recurring

Never make a channel or event name depend entirely on user input. Use an ID-based name by default and treat user text as an optional label that can fail gracefully. Content blocked by a server's own AutoMod rules is a different code, 200001.

Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.

Related codes

Error 20031 - quick answers

What does Discord error 20031 mean?

The name or text field you tried to set contains a word Discord does not allow in that field. The literal message names the fields this applies to: Stage topics, server names, server descriptions and channel names. It is Discord's own word filter, separate from any AutoMod rules the server configured.

How do I fix Discord error 20031?

1. Catch 20031 on name updates and ask the user to choose different text 2. Fall back to a neutral generated name (for example ticket-1234) when user-derived names are rejected 3. Log the rejected text for moderators, without echoing it back into the server 4. Retry with the fallback name and confirm the channel is created

Stop debugging Discord by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.