> ## Documentation Index
> Fetch the complete documentation index at: https://docs.razebot.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Word Filter

> Block specific words, phrases, and regex patterns from being sent in your server.

# Word Filter

> Block specific words, phrases, and regex patterns from being sent in your server.

## Overview

The word filter scans every message against a list of banned words and regex patterns you define. Matches are deleted immediately. Supports plain words, substrings, and full regular expressions.

## Managing words

<AccordionGroup>
  <Accordion icon="plus" title="Add a word">
    <CodeGroup>
      ```bash Syntax theme={null} theme={null}
      ;filter add (word)
      ```

      ```bash Example theme={null} theme={null}
      ;filter add badword
      ```
    </CodeGroup>

    Words are matched as substrings — `bad` matches `bad`, `badword`, `really-bad`, etc.
  </Accordion>

  <Accordion icon="minus" title="Remove a word">
    <CodeGroup>
      ```bash Syntax theme={null} theme={null}
      ;filter remove (word)
      ```

      ```bash Example theme={null} theme={null}
      ;filter remove badword
      ```
    </CodeGroup>
  </Accordion>

  <Accordion icon="list" title="List all filtered words">
    ```bash theme={null} theme={null}
    ;filter list
    ```

    Shows all blocked words and patterns. Regex entries are marked with a `regex` tag.
  </Accordion>

  <Accordion icon="rotate-left" title="Reset all words">
    ```bash theme={null} theme={null}
    ;filter reset
    ```

    Removes every entry from the word filter. This cannot be undone.
  </Accordion>
</AccordionGroup>

## Regex patterns

Add a regular expression to catch more complex patterns that plain words can't handle.

<CodeGroup>
  ```bash Syntax theme={null} theme={null}
  ;filter regex (pattern)
  ```

  ```bash Example theme={null} theme={null}
  ;filter regex (discord|dsc)\.gg/[a-z]+
    ;filter regex \b(buy|sell)\s+crypto\b
  ```
</CodeGroup>

<Warning>
  Invalid regex patterns are rejected before saving. Test your pattern at [regex101.com](https://regex101.com) first.
</Warning>

## Whitelist a word

Remove a word or pattern from the filter without using `filter remove` — useful for quickly un-blocking something.

<CodeGroup>
  ```bash Syntax theme={null} theme={null}
  ;filter whitelist (word)
  ```

  ```bash Example theme={null} theme={null}
  ;filter whitelist badword
  ```
</CodeGroup>

## Migrate to Discord Automod

Export all non-regex words directly into a Discord native Automod rule. Existing keyword rules are merged rather than replaced.

```bash theme={null} theme={null}
;filter wordmigrate
```

<Info>
  Only plain words are migrated — regex patterns stay in raze's filter only.
</Info>

## Exempt roles

Roles added here bypass the word filter entirely.

<Tabs>
  <Tab title="Toggle exemption">
    ```bash theme={null} theme={null}
    ;filter exempt @Moderators
    ```

    Running the command again removes the exemption.
  </Tab>

  <Tab title="View exemptions">
    ```bash theme={null} theme={null}
    ;filter exempt list
    ```
  </Tab>
</Tabs>

## Log channel

<CodeGroup>
  ```bash Set theme={null} theme={null}
  ;filter logs #mod-log
  ```

  ```bash Remove theme={null} theme={null}
  ;filter logs remove
  ```

  ```bash View theme={null} theme={null}
  ;filter logs view
  ```
</CodeGroup>
