# Block Lists

A Block List is a list of words that you can use to moderate chat messages. Stream Chat comes with a built-in Block List called `profanity_en_2020_v1` which contains over a thousand of the most common profane words.

You can manage your own block lists via the Stream dashboard or APIs to a manage blocklists and configure your channel types to use them. Channel types can be configured to block or flag messages from your users based on your blocklists. To do this you need to configure your channel type(s) with these two configurations: `blocklist` and `blocklist_behavior` . The first one refers to the name of the block list and the second must be set as `block` or `flag` .

- Applications can have up to 15 block lists in total alongside advanced filters

- A Block List can contain up to 10,000 words, each word can be up to 40 characters

- The block list words must be in lowercase

- Text matching is done with case insensitive word match (no prefix, post-fix support)

- Messages are split into words using white spaces and hyphens (cookie-monster matches both "cookie" and "monster")

So for instance, if you have a block list with the word "cream" these messages will be blocked or flagged:

- She jabbed the spoon in the ice cream and sighed

- Cream is the best

and it will not affect any of these

- Is creamcheese a word?

- I did not enjoy watching Scream

<admonition type="info">

The default block list contains material that many will find offensive.

</admonition>

### Setup example

Block Lists can be managed using the APIs like any other Chat feature. Here is a simple example on how to create a Block List and use it for a channel type.

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// add a new block list for this app
await client.createBlockList({
  name: "no-cakes",
  words: ["fudge", "cream", "sugar"],
});

// use the block list for all channels of type messaging
await client.updateChannelType("messaging", {
  blocklist: "no-cakes",
  blocklist_behavior: "block",
});
```

</codetabs-item>

<codetabs-item value="php" label="PHP">

```php
// add a new block list for this app
$client->createBlocklist(["no-cakes" => $name, "words" => ["fudge", "cream", "sugar"]]);
```

</codetabs-item>

<codetabs-item value="python" label="Python">

```python
# add a new block list for this app
client.create_blocklist(name="no-cakes", words=["fudge", "cream", "sugar"])

# use the block list for all channels of type messaging
client.update_channel_type("messaging", blocklist="no-cakes", blocklist_behavior="block")
```

</codetabs-item>

<codetabs-item value="ruby" label="Ruby">

```ruby
# require 'stream-chat'

# add a new block list for this app
client.create_blocklist("no-cakes", words: ["fudge", "cream", "sugar"])

# use the block list for all channels of type messaging
client.update_channel_type("messaging", blocklist: "no-cakes", blocklist_behavior: "block")
```

</codetabs-item>

<codetabs-item value="java" label="Java">

```java
// add a new block list for this app
Blocklist.create()
  .name("no-cakes")
  .words(List.of("fudge", "cream", "sugar"))
  .request();

// use the block list for all channels of type messaging
ChannelType.update("messaging")
  .blocklist("no-cakes")
  .blocklistBehavior(ChannelType.BlocklistBehavior.BLOCK)
  .request();
```

</codetabs-item>

<codetabs-item value="go" label="Go">

```go
// add a new block list for this app
blocklistReq := &BlocklistCreateRequest{BlocklistBase{Name: "no-cakes", Words: []string{"fudge", "cream", "sugar"}}}
client.CreateBlocklist(ctx, blocklistReq)

// use the block list for all channels of type messaging
client.UpdateChannelType(ctx, "messaging", map[string]interface{}{
 "blocklist": "no-cakes",
 "blocklist_behavior": "block",
})
```

</codetabs-item>

<codetabs-item value="csharp" label="C#">

```csharp
// add a new block list for this app
await blocklistClient.CreateAsync(new BlocklistCreateRequest
{
  Name = "no-cakes",
  Words = new[] { "fudge", "cream", "sugar" },
});

// use the block list for all channels of type messaging
```

</codetabs-item>

</codetabs>

### List available block lists

All applications have the  `profanity_en_2020_v1`  block list available. This endpoint returns all block lists available for this application.

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
await client.listBlockLists();
```

</codetabs-item>

<codetabs-item value="php" label="PHP">

```php
$client->listBlocklists();
```

</codetabs-item>

<codetabs-item value="python" label="Python">

```python
client.list_blocklists()
```

</codetabs-item>

<codetabs-item value="ruby" label="Ruby">

```ruby
client.list_blocklists()
```

</codetabs-item>

<codetabs-item value="java" label="Java">

```java
Blocklist.list().request();
```

</codetabs-item>

<codetabs-item value="go" label="Go">

```go
client.ListBlocklists(ctx)
```

</codetabs-item>

<codetabs-item value="csharp" label="C#">

```csharp
await blocklistClient.ListAsync();
```

</codetabs-item>

</codetabs>

### Describe a block list

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
await client.getBlockList("no-cakes");
```

</codetabs-item>

<codetabs-item value="php" label="PHP">

```php
$client->getBlocklist("no-cakes");
```

</codetabs-item>

<codetabs-item value="python" label="Python">

```python
client.get_blocklist("no-cakes")
```

</codetabs-item>

<codetabs-item value="ruby" label="Ruby">

```ruby
client.get_blocklist("no-cakes")
```

</codetabs-item>

<codetabs-item value="java" label="Java">

```java
Blocklist.get("no-cakes").request();
```

</codetabs-item>

<codetabs-item value="go" label="Go">

```go
c.GetBlocklist(ctx, "no-cakes")
```

</codetabs-item>

<codetabs-item value="csharp" label="C#">

```csharp
await blocklistClient.GetAsync("no-cakes");
```

</codetabs-item>

</codetabs>

### Create new block list

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
const words = ["fudge", "cream", "sugar"];
await client.createBlockList({
  name: "no-cakes",
  words,
});
```

</codetabs-item>

<codetabs-item value="php" label="PHP">

```php
$client->createBlocklist(["no-cakes" => $name, "words" => ["fudge", "cream", "sugar"]]);
```

</codetabs-item>

<codetabs-item value="python" label="Python">

```python
client.create_blocklist(name="no-cakes", words=["fudge", "cream", "sugar"])
```

</codetabs-item>

<codetabs-item value="ruby" label="Ruby">

```ruby
client.create_blocklist("no-cakes", words: ["fudge", "cream", "sugar"])
```

</codetabs-item>

<codetabs-item value="java" label="Java">

```java
Blocklist.create()
  .name("no-cakes")
  .words(List.of("fudge", "cream", "sugar"))
  .request();
```

</codetabs-item>

<codetabs-item value="go" label="Go">

```go
blocklistReq := &BlocklistCreateRequest{BlocklistBase{Name: "no-cakes", Words: []string{"fudge", "cream", "sugar"}}}
client.CreateBlocklist(ctx, blocklistReq)
```

</codetabs-item>

<codetabs-item value="csharp" label="C#">

```csharp
await blocklistClient.CreateAsync(new BlocklistCreateRequest
{
  Name = "no-cakes",
  Words = new[] { "fudge", "cream", "sugar" },
});
```

</codetabs-item>

</codetabs>

### Update a new block list

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
await client.updateBlockList("no-cakes", {
  words: ["fudge", "cream", "sugar", "vanilla"],
});
```

</codetabs-item>

<codetabs-item value="php" label="PHP">

```php
$client->updateBlocklist("no-cakes", ["words" => ["fudge", "cream", "sugar", "vanilla"]]);
```

</codetabs-item>

<codetabs-item value="python" label="Python">

```python
client.update_blocklist("no-cakes", words=["fudge", "cream", "sugar", "vanilla"])
```

</codetabs-item>

<codetabs-item value="ruby" label="Ruby">

```ruby
client.update_blocklist("no-cakes", words: ["fudge", "cream", "sugar", "vanilla"])
```

</codetabs-item>

<codetabs-item value="java" label="Java">

```java
Blocklist.update("no-cakes")
  .words(List.of("fudge", "cream", "sugar", "vanilla"]))
  .request();
```

</codetabs-item>

<codetabs-item value="go" label="Go">

```go
client.UpdateBlocklist(ctx, "no-cakes", []string{"fudge", "cream", "sugar", "vanilla"})
```

</codetabs-item>

<codetabs-item value="csharp" label="C#">

```csharp
await blocklistClient.UpdateAsync("no-cakes", new[] { "fudge", "cream", "sugar", "vanilla" });
```

</codetabs-item>

</codetabs>

### Delete a block list

When a block list is deleted, it will be automatically removed from all channel types that were using it.

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
await client.deleteBlockList("no-cakes");
```

</codetabs-item>

<codetabs-item value="php" label="PHP">

```php
$client->deleteBlocklist("no-cakes");
```

</codetabs-item>

<codetabs-item value="python" label="Python">

```python
client.delete_blocklist("no-cakes")
```

</codetabs-item>

<codetabs-item value="ruby" label="Ruby">

```ruby
client.delete_blocklist("no-cakes")
```

</codetabs-item>

<codetabs-item value="java" label="Java">

```java
Blocklist.delete("no-cakes").request();
```

</codetabs-item>

<codetabs-item value="go" label="Go">

```go
client.DeleteBlocklist(ctx, "no-cakes")
```

</codetabs-item>

<codetabs-item value="csharp" label="C#">

```csharp
await _blocklistClient.DeleteAsync("no-cakes");
```

</codetabs-item>

</codetabs>

---

This page was last updated at 2025-08-15T14:15:09.939Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/react/block_lists/](https://getstream.io/chat/docs/react/block_lists/).