# Disabling Channels

Disabling a channel is a visibility and access toggle. The channel and all its data remain intact, but client-side read and write operations return a `403 Not Allowed` error. Server-side access is preserved for admin operations like moderation and data export.

Disabled channels still appear in query results by default. This means users see the channel in their list but receive errors when attempting to open it. To hide disabled channels from users, filter them out in your queries:

```js
await client.queryChannels({ disabled: false });
```

Re-enabling a channel restores full client-side access with all historical messages intact.

## Disable a Channel

<codetabs>

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

```js
// disable a channel with full update
await channel.update({ disabled: true });

// disable a channel with partial update
await channel.updatePartial({ set: { disabled: true } });

// enable a channel with full update
await channel.update({ disabled: false });

// enable a channel with partial update
await channel.updatePartial({ set: { disabled: false } });
```

</codetabs-item>

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

```php
// disable a channel with full update
$channel->update(["disabled" => true]);

// disable a channel with partial update
$channel->updatePartial(["disabled" => true]);

// enable a channel with full update
$channel->update(["disabled" => false]);

// enable a channel with partial update
$channel->updatePartial(["disabled" => false]);
```

</codetabs-item>

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

```python
# disable a channel with full update
channel.update({"disabled": True})

# disable a channel with partial update
channel.update_partial(to_set={"disabled": True})

# enable a channel with full update
channel.update({"disabled": False})

# enable a channel with partial update
channel.update_partial(to_set={"disabled": False})
```

</codetabs-item>

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

```ruby
# require 'stream-chat'

# disable a channel with full update
channel.update({"disabled" => true})

# disable a channel with partial update
channel.update_partial({"disabled" => true})

# enable a channel with full update
channel.update({"disabled" => false})

# enable a channel with partial update
channel.update_partial({"disabled" => false})
```

</codetabs-item>

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

```java
// disable a channel with full update
Channel.update("<channel-type>", "<channel-id>")
  .data(ChannelRequestObject.builder().additionalField("disabled", true).build())
  .request();

// disable a channel with partial update
Channel.partialUpdate("<channel-type>", "<channel-id>")
  .setValue("disabled", true)
  .request();


// enable a channel with full update
Channel.update("<channel-type>", "<channel-id>")
  .data(ChannelRequestObject.builder().additionalField("disabled", false).build())
  .request();

// enable a channel with partial update
Channel.partialUpdate("<channel-type>", "<channel-id>")
  .setValue("disabled", false)
  .request();
```

</codetabs-item>

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

```csharp
// disable a channel with full update
var updateReq = new ChannelUpdateRequest { Data = new ChannelRequest() };
updateReq.Data.SetData("disabled", true);
await channelClient.UpdateAsync("<channel-type>", "<channel-id>", updateReq);

// disable a channel with partial update
var channelUpdates = new PartialUpdateChannelRequest
{
  Set = new Dictionary<string, object> { { "disabled", true } },
};
await channelClient.PartialUpdateAsync("<channel-type>", "<channel-id>", channelUpdates);

// enable a channel with full update
var updateReq = new ChannelUpdateRequest { Data = new ChannelRequest() };
updateReq.Data.SetData("disabled", false);
await channelClient.UpdateAsync("<channel-type>", "<channel-id>", updateReq);

// enable a channel with partial update
var enableUpdates = new PartialUpdateChannelRequest
{
  Set = new Dictionary<string, object> { { "disabled", false } },
};
await channelClient.PartialUpdateAsync("<channel-type>", "<channel-id>", enableUpdates);
```

</codetabs-item>

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

```go
// disable a channel with full update
channel.Update(ctx, map[string]interface{}{"disabled": true}, nil)

// disable a channel with partial update
channel.PartialUpdate(ctx, PartialUpdate{
	Set: map[string]interface{}{
		"disabled": true,
	},
})

// enable a channel with full update
channel.Update(ctx, map[string]interface{}{"disabled": false}, nil)

// enable a channel with partial update
channel.PartialUpdate(ctx, PartialUpdate{
	Set: map[string]interface{}{
		"disabled": false,
	},
})
```

</codetabs-item>

<codetabs-item value="unity" label="Unity">

```csharp
// For security reasons, disabling channels is only possible via a server-side SDK
```

</codetabs-item>

</codetabs>

<admonition type="info">

To prevent new messages while still allowing users to read existing messages, use [freeze the channel](/chat/docs/<framework>/freezing_channels/) instead.

</admonition>


---

This page was last updated at 2026-03-05T19:05:41.995Z.

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