---
source_url: https://www.pubnub.com/docs/chat/chat-sdk/build/features/moderation
title: Moderate users and messages
updated_at: 2026-06-11T11:33:37.621Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Moderate users and messages

:::tip Related moderation approaches
Chat SDK provides programmatic muting, banning, and flagging. See also: [Auto Moderation](https://www.pubnub.com/docs/bizops-workspace/auto-moderation) (AI-powered), [Channel Monitor](https://www.pubnub.com/docs/bizops-workspace/channel-monitor) (manual review), [Moderation Overview](https://www.pubnub.com/docs/general/moderation/overview).
:::

Chat SDK offers multiple approaches for moderating users and messages.

## Flag messages

Users can [flag a message](https://www.pubnub.com/docs/chat/chat-sdk/build/features/messages/moderation) to report offensive content. A reason is required.

## Mute users

### As an admin

Admins can [mute](https://www.pubnub.com/docs/chat/chat-sdk/build/features/users/moderation#mute-or-ban-users-as-an-administrator) users to block them from posting. With [Access Manager](https://www.pubnub.com/docs/chat/chat-sdk/build/features/users/permissions), revoke `write` access so muted users can read but not send messages.

:::warning Access Manager with client-side mute list
When using Access Manager with `syncMutedUsers` enabled, grant these permissions (replace `$currentUserId` with the user's ID):
* `read` on channel `PN_PRV.$currentUserId.mute1`
* `update`, `delete`, `get` for user `PN_PRV.$currentUserId.mute1`
:::

:::note Secret Key required
Mute and ban operations require a **Secret Key** (from [Admin Portal](https://admin.pubnub.com/)). Use only on secure servers, never expose to clients. If compromised, generate a new key in Admin Portal.
:::

### As a user

Users can [mute others](https://www.pubnub.com/docs/chat/chat-sdk/build/features/users/moderation-user) on their client to hide incoming and historical messages (other users still see them).

The mute list holds up to 200 users and persists only for the session by default. [Enable persistence](https://www.pubnub.com/docs/chat/chat-sdk/build/configuration#sync-muted-users) to save and retrieve the list across sessions.

## Ban users

Admins can [ban](https://www.pubnub.com/docs/chat/chat-sdk/build/features/users/moderation#mute-or-ban-users) users to block both posting and reading. With [Access Manager](https://www.pubnub.com/docs/chat/chat-sdk/build/features/users/permissions), revoke `read` and `write` access.

## Check user restrictions

[Check user restrictions](https://www.pubnub.com/docs/chat/chat-sdk/build/features/users/moderation#check-restrictions) to verify mute or ban status before allowing operations.

Combine moderation restrictions with Access Manager rules for comprehensive protection. Access Manager verifies permissions against moderation restrictions before granting access.

## Listen to flagging events

Monitor [reported message events](https://www.pubnub.com/docs/chat/chat-sdk/build/features/messages/moderation#listen-to-report-events) as an admin.

### Handle flagging events

Add custom moderation logic or integrate with third-party services via [PubNub Integrations](https://www.pubnub.com/integrations/) (import from Admin Portal's Functions tab for profanity filtering and more).

## Prevent message spamming

Set client-side rate limits per channel type (direct, group, public) using `rateLimitPerChannel` and `rateLimitFactor` during initialization. See [Configuration](https://www.pubnub.com/docs/chat/chat-sdk/build/configuration) for details.