# 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.

Users don't see disabled channels in their query results unless their role has the `ReadDisabledChannel` permission. For users with that permission, and for server-side queries, disabled channels are returned, except when the filter includes `members`: then they are left out unless you pass `disabled: true`. To exclude disabled channels explicitly, filter them out in your queries:

```js label="JavaScript"
await client.queryChannelsAndHydrate({
  filter_conditions: { disabled: false },
});
```

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

## Disable a Channel

For security reasons, disabling and re-enabling a channel is only possible from a server-side SDK.

```js label="Node.js"
const channel = client.chat.channel("messaging", "general");

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

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

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

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

>
> **Info:** To prevent new messages while still allowing users to read existing messages, use [freeze the channel](https://getstream.io/chat/docs/ios-swift/freezing-channels/) instead.
>

---

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/ios-swift/disabling-channels/](https://getstream.io/chat/docs/ios-swift/disabling-channels/).