# 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

```java label="Java"
// disable a channel with full update
chat.updateChannel("<channel-type>", "<channel-id>", UpdateChannelRequest.builder()
    .data(ChannelInputRequest.builder().disabled(true).build())
    .build()).execute();

// disable a channel with partial update
chat.updateChannelPartial("<channel-type>", "<channel-id>",
    UpdateChannelPartialRequest.builder()
        .set(Map.of("disabled", true))
        .build()).execute();

// enable a channel with full update
chat.updateChannel("<channel-type>", "<channel-id>", UpdateChannelRequest.builder()
    .data(ChannelInputRequest.builder().disabled(false).build())
    .build()).execute();

// enable a channel with partial update
chat.updateChannelPartial("<channel-type>", "<channel-id>",
    UpdateChannelPartialRequest.builder()
        .set(Map.of("disabled", false))
        .build()).execute();
```

<Admonition type="info">

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

</Admonition>


---

This page was last updated at 2026-08-07T20:37:58.684Z.

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