Back to Tutorials

Setting Up Moderation Filters

How Moderation's filters work, two worked examples, and why a punishment might not fire.

1

What Moderation Filters do

Moderation checks every message against rules you define, called filters. Each filter has one trigger (the thing to watch for) and one action it takes when that trigger fires, from deleting the message to a full ban. There are fifteen trigger types, covering everything from blocked words and links to spam and excessive caps.

See the full reference
2

Example: blocking specific words

Say you want to catch a banned phrase anywhere in chat, including sloppy attempts to dodge it with symbols or spacing. Here's a filter that does exactly that:

FieldValue
NameBlacklisted Words
TypeBlacklist
Words (Wildcards)badword, b4dword*
Match Close VariantsOn
ActionDelete Message + Warn
3

Example: blocking invite links

Invite filters work the other way around. They block every Discord invite by default and only allow what you explicitly list. Here's a filter that blocks everything except your own server's invite:

FieldValue
NameInvite Filter
TypeInvites
Allowed Invites / Server IDsdiscord.gg/yourserver
ActionDelete Message
4

Scoping a filter to channels and roles

Every filter has its own Restrictions tab with four independent lists:

  • Affected Channels: leave it empty and the filter runs everywhere. List specific channels to run it only there, for example to limit a strict filter to one channel.
  • Excluded Channels: channels the filter always skips, even if Affected Channels would include them. Useful for a staff-only or bot-command channel.
  • Affected Roles: the same idea, based on the message author's roles. Leave it empty to check everyone, or limit it to specific roles.
  • Excluded Roles: roles that always bypass this filter, in addition to anyone already excluded automatically.
5

Staff are excluded automatically

You don't need to add your staff to every filter's Excluded Roles by hand.

6

If a punishment doesn't fire

A filter can trigger correctly and still fail to apply its action. These are the most common reasons:

  • AutoMod's role sits below the target's highest role. See Getting Started for how to fix the role order.
  • AutoMod is missing the Discord permission for that action: Kick Members, Ban Members, Moderate Members for mutes, or Manage Roles for role actions.
  • A channel-specific permission overwrite is blocking AutoMod in that one channel, even though its role has the permission server-wide.
  • The target has one of your Moderator Roles. Staff covered by that setting can't be punished by an automatic action.
  • The message came from a channel or role that the filter's Restrictions exclude. See the previous step.

You've got the basics

From here, explore Punishment escalation (warn thresholds that upgrade to a bigger punishment) and Discord's native AutoMod rules, both on the Moderation page.