Back to Blog

How to Create Custom AutoMod Keyword & Regex Rules in Discord (2026)

Peak Team·June 12, 2026·9 min read
By the PeakBot Team — powering 500+ Discord communities
Key Takeaways
  • Before you write a single rule, it helps to know exactly what you're working with.
  • Discord gives you three ways to express a pattern, and people constantly mix them up.
  • Go to Server Settings → AutoMod.
  • Discord's AutoMod uses the Rust regex engine, which is mostly standard but has two quirks worth knowing: it does not support lookahead or lookbehind ((?=...), (?<=...)), and it does not support backreferences.
  • AutoMod has hard limits, and you'll plan your rules better if you know them up front:
  • A rule does nothing until you tell it what happens on a match.

How to Create Custom AutoMod Keyword & Regex Rules in Discord (2026)

To set up a custom keyword or regex AutoMod rule in Discord, open Server Settings → AutoMod → "Custom keyword filter," add your blocked words or wildcard patterns (or one regex pattern), then choose an action like Block Message, Send Alert, or Timeout. You need the Manage Server permission, and the whole thing lives natively in Discord with no bot required for the basic rule.

Discord's built-in AutoMod is genuinely good at one thing: catching exact words and patterns the moment they're posted, before a human moderator ever sees them. This guide walks through creating those custom rules from scratch, explains how keyword filters, wildcards, and full regex actually differ, covers the limits you'll hit, and shows where you'll want AI moderation layered on top to catch the stuff a keyword list never will.

What custom AutoMod rules can and can't catch

Before you write a single rule, it helps to know exactly what you're working with. Discord AutoMod is a pattern matcher. It scans message content as it's sent and compares it against rules you define. It runs natively on every message at no cost.

What it catches well:

  • Exact words and phrases ("free nitro", a specific scam URL, a banned username)
  • Variations of a word using wildcards (scam* catches "scammer", "scamming")
  • Structured patterns using regex (Discord invite links, phone-number formats, repeated characters)
  • Mention spam, excessive caps, and known spam content (via Discord's preset filters)

What it can't catch:

  • Intent. AutoMod has no idea whether "this game is killing me" is a threat or a compliment.
  • Context. It can't tell that the same word is fine in a venting channel and against the rules in a support channel.
  • Obfuscation it hasn't seen. People route around keyword lists with spacing, lookalike characters, and slang faster than you can add rules.

That gap is the whole reason this guide ends with PeakBot's context-aware AI moderation. Keyword rules are your fast, deterministic first layer. AI moderation reads what the keyword list misses. You want both. With that framing set, here's how to build the keyword layer properly.

Keyword filters vs wildcards vs full regex

Discord gives you three ways to express a pattern, and people constantly mix them up. They behave differently.

Plain keywords match a whole word, case-insensitively. If you block idiot, AutoMod flags "idiot" and "Idiot" but not "idiots" (because that's a different word) and not "idiotic." Plain keywords are the safest option and cause the fewest false positives.

Wildcards use the * symbol to match partial words. The position of the asterisk matters:

  • scam* matches anything starting with "scam" — scammer, scamming, scams
  • *scam matches anything ending in "scam"
  • *scam* matches "scam" anywhere inside a word, including "descambled" (which is why loose wildcards cause false positives)

Full regex is a single regular-expression pattern per slot, written in the Rust regex flavor. This is for structured text — links, codes, number formats — not for word lists. We'll cover the syntax below.

A good rule of thumb: use plain keywords for clear slurs and banned phrases, wildcards for word families you want to block in all their forms, and regex only when you're matching a shape of text rather than specific words.

Step 1: Open AutoMod and create a custom keyword rule

Go to Server Settings → AutoMod. You'll see Discord's preset rules (spam, mention spam, harmful links) and an option to create your own. Click Custom keyword filter and give the rule a clear name like "Scam phrases" or "Banned words."

This is where you'll add your keywords, wildcards, or a regex pattern. You can create multiple separate custom rules, each with its own keyword set and its own action — for example, one rule that blocks slurs and one that just alerts moderators about borderline phrases.

Step 2: Write your first keyword rule

Start simple. In the Keywords field, add the exact words or phrases you want blocked, one entry at a time. A practical starter set for most public servers:

  • Common scam bait: free nitro, nitro giveaway, steam gift, claim your
  • Specific scam domains your server keeps getting hit with
  • Slurs and harassment terms appropriate to your community's rules

Then add a few wildcards for word families:

  • scam* — catches scammer, scamming, scams
  • phish* — catches phishing, phisher

You can also set allow-list exceptions on the same rule. If claim your is blocking a legitimate "claim your role" message in your onboarding channel, add "claim your role" to the allow list so that exact phrase passes. This is the single most useful feature for taming an over-eager rule. If a rule starts flagging normal conversation, our guide on how to fix Discord AutoMod false positives walks through tightening patterns and using exemptions properly.

Step 3: Learn regex basics for moderators (the Rust flavor)

Discord's AutoMod uses the Rust regex engine, which is mostly standard but has two quirks worth knowing: it does not support lookahead or lookbehind ((?=...), (?<=...)), and it does not support backreferences. Patterns also run case-insensitively by default. Everything else you'd expect is there.

Here are the building blocks moderators actually use:

  • . — any single character
  • \d — any digit; \w — any word character (letter, digit, underscore); \s — whitespace
  • * — zero or more of the previous; + — one or more; ? — zero or one
  • {2,5} — between 2 and 5 of the previous
  • [abc] — any one of a, b, c; [a-z] — any lowercase letter
  • | — OR; (red|blue) matches either
  • ^ start of string, $ end of string
  • \. — a literal dot (escape special characters with a backslash)

Some real, useful patterns:

  • Catch character-spam (one letter repeated many times): (.)\1 won't work since backreferences are unsupported, so instead target a known character flood like a{6,} to flag "aaaaaa" and longer.
  • Match a phone-number shape: \d{3}[-.\s]\d{3}[-.\s]\d{4} catches "555-123-4567" and "555.123.4567".
  • Match Discord invite links posted as text: (discord\.gg|discord\.com/invite)/\w+.
  • Block a family of lookalike scam URLs: (disc[o0]rd|st[e3]am)-?(gift|nitro)\.\w+.

Test every regex pattern against both the text you want caught and normal text you don't want caught before you set the action to block. Regex that's too greedy is the number-one cause of AutoMod headaches.

Step 4: Work within Discord's rule and pattern limits

AutoMod has hard limits, and you'll plan your rules better if you know them up front:

  • Keyword filter rules: up to 6 custom keyword rules per server (this is in addition to the preset spam, mention, and link filters).
  • Keywords per rule: up to 1,000 keyword/wildcard entries.
  • Keyword length: each entry can be up to 60 characters.
  • Regex: up to 10 regex patterns per custom keyword rule, and a single regex pattern is capped at 260 characters.
  • Allow list: up to 100 allow-list entries per rule (larger on mention-spam rules).

Because regex slots are limited, don't waste them on things a plain keyword could handle. Reserve regex for structured text — links, codes, number shapes — and use keyword/wildcard entries for everything word-based. If you're building a serious blocklist, split your rules across the preset and custom filters so a single rule doesn't get bloated and slow to maintain — for example, keep scam-link regex in one rule and word-based slurs in another.

Step 5: Set the action — block, alert, or timeout

A rule does nothing until you tell it what happens on a match. Discord gives you three actions, and you can combine them on a single rule:

  • Block Message — the message is never posted. The sender sees a notice that it was blocked. This is your default for anything clearly against the rules.
  • Send Alert — a copy of the flagged message is posted to a moderator channel you pick. Use this alone for borderline phrases you want eyes on but not auto-removed, or alongside Block so mods have a record.
  • Timeout — the member is muted for a duration you set (up to a few hours). Reserve this for serious violations like slurs or raid behavior; a timeout on a false positive is a great way to annoy real members.

A sensible setup for most servers: Block + Send Alert for scams and slurs, Send Alert only for borderline language, and Timeout only on a tightly written, high-confidence rule. Pair this with strong link filtering — our walkthrough on how to set up Discord AutoMod to block spam and scam links covers the preset link rules that complement your custom patterns.

Step 6: Layer AI moderation on top with PeakBot

Here's where native AutoMod hits its ceiling. A keyword list only catches what you predicted. The moment someone reworks an insult, spaces out a slur, or posts a brand-new scam template, your rules are blind until you manually add the pattern. You end up in a losing arms race, editing wildcards every week.

PeakBot adds a second layer that works differently. Its context-aware AI moderation reads message intent and adapts per channel, instead of matching a fixed blocklist. It can tell that the same word is a joke between friends in one channel and harassment aimed at someone in another, and it flags obfuscated or rephrased content your regex never anticipated. You keep your fast, deterministic Discord AutoMod rules for the obvious stuff, and let the AI catch what falls in the gap.

PeakBot is a free, AI-powered Discord bot, and AI moderation is one of its 30+ free features — no trial, no time limit. It also replaces MEE6, Carl-bot, Dyno, and TidyCord with a single bot, so you're not stacking several premium subscriptions to get logging, leveling, tickets, and moderation in one place. It's already powering 500+ Discord communities.

To compare honestly: Discord's native AutoMod is free and hard to beat for instant, exact-match blocking. MEE6 (premium $11.95/mo) is the most recognizable name and has a large preset library. Carl-bot (premium $7.99/mo) has excellent reaction-role and automod tooling that power users rely on. Dyno (premium $4.99/mo) is reliable and inexpensive. Where PeakBot fits is the AI layer on top of all of that — intent-based moderation plus the rest of the stack for free, with Pro at $8.25/month ($69/year) only if you want extras like the AI Server Builder. Use native AutoMod and PeakBot together and you've covered both the known and the unknown.

Frequently asked questions

Does Discord AutoMod support full regex?

Yes. Discord AutoMod supports the Rust regex flavor in custom keyword rules, with up to 10 regex patterns per custom keyword rule and a 260-character cap per pattern. It does not support lookahead, lookbehind, or backreferences, so write patterns that match left to right.

How many custom AutoMod rules can I create?

You can create up to 6 custom keyword filter rules per server, each holding up to 1,000 keyword or wildcard entries (60 characters each). These are separate from Discord's preset spam, mention-spam, and harmful-link filters, which you can also enable.

What's the difference between a keyword and a wildcard in AutoMod?

A plain keyword matches a whole word case-insensitively, so idiot won't catch "idiots." A wildcard uses * to match partial words — scam* catches "scammer" and "scamming." Wildcards are more powerful but cause more false positives, so use the tightest pattern that does the job.

Will AutoMod catch slurs that people deliberately misspell?

Not reliably. AutoMod only matches the exact words and patterns you've listed, so someone spacing out letters or swapping in lookalike characters can slip past a keyword rule. This is exactly the gap that PeakBot's context-aware AI moderation is built to close, since it reads intent rather than matching a fixed list.

Do I need a bot to use custom AutoMod rules?

No. Custom keyword and regex rules are built into Discord and only require the Manage Server permission. You'd add a bot like PeakBot when you want AI moderation, logging, leveling, tickets, and the rest of the stack on top of the native rules.

Try PeakBot free on your server

Setup takes 30 seconds.

Free forever · Setup in 30 seconds

Ready to level up your server?

30+ features included free. Moderation, welcome messages, XP & leveling, tickets, reaction roles, and more.

See All Features