> ## Documentation Index
> Fetch the complete documentation index at: https://codebeans-cb-checkout-rules.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Keyword Matching Rule

> Block checkout when a field contains words or characters you don't allow.

Use this rule to stop words or characters you don't want in an order. For example, block `test` or `fake` in the name, or block emojis and symbols that your shipping software can't print.

## How it works

You add one or more fields, and give each field its own list of keywords, shipping or billing choice and message. Checkout is blocked when the field **contains** any keyword from its list.

* Matching ignores upper and lower case: `Test` matches `test`.
* A keyword matches anywhere in the field, including inside a longer word: `box` matches `Mailbox Lane`.

| Keyword | Field value | Result |
| - | - | - |
| `test` | `John Test` | Blocked |
| `test` | `Testa Street` | Blocked |
| `#` | `Flat #4` | Blocked |
| `test` | `John Smith` | Allowed |

## Set up the rule

**1. Select the fields**

Click **Select fields to add validation** and tick the fields to check. Each field you tick gets its own card.

**2. Add keywords**

In the field's card, type a keyword and press **Enter** or type a comma to add it. Click **Add special characters** to add common symbols in one step: `@ $ * ? ! # % ^ & ( ) - _ + = { } [ ] | \ : ; " ' < > , . /`

**3. Choose shipping or billing**

For address fields, tick **Shipping address**, **Billing address** or both.

**4. Write the message**

Under **Message to display**, write what the customer sees. English is required for each field.

### Fields you can check

| Group | Fields |
| - | - |
| Contact | Contact email, Contact phone |
| Shipping / Billing address | City, Address line 1, Address line 2, Company, First name, Last name, Zip, Phone |

The message appears next to the field that contains the keyword.

> [!WARNING]
>
> Be careful with special characters. Blocking `.` or `-` also blocks many real addresses, emails and phone numbers. Only block the characters that cause you problems.

## Other settings

This rule has no country setting. It checks every order. It also has the **Rule status** and **Checkout behavior** settings described in [Common rule settings](https://codebeans-cb-checkout-rules.mintlify.site/rules/common-settings.md).

## Example message

```text theme={null}
Please remove special characters such as # or @ from your address.
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.