Maximum Message Length
Better Messages can cap how long a single message is allowed to be. When set, the composer shows a live character counter as users approach the limit and prevents sending messages that exceed it. Server-side enforcement ensures the limit is never bypassed by a custom client or API call.
What it adds#
- Configurable per-message character limit, site-wide
- Live counter that appears in the composer at 80% of the limit
- Counter turns red and Send button is disabled when the limit is exceeded
- Tooltip explains the limit on hover
- Server-side enforcement via REST β over-limit messages rejected with a clear error
- Applies to both new messages and edits
- Emoji-aware counting β family emojis (π¨βπ©βπ§), skin-tone variants (ππ½), country flags (πΊπΈ) count as one character each
How it works#
Set a maximum number of characters in Settings β Messaging β Maximum Message Length. As soon as a user crosses 80% of the configured limit, a small counter appears in the composer next to the Send button. When the message goes over the limit:
| State | UI behavior |
|---|---|
| < 80% of limit | No counter shown (clean UI) |
| 80β100% of limit | Counter appears, showing used / total |
| Over the limit | Counter turns red, Send button disabled |
| User trims to under limit | Counter returns to neutral, Send button re-enabled |
The limit is enforced on both client and server β client UI is fast feedback, server-side REST validation is the real guard. Bypass attempts via custom clients fail with a localized error response.
Each grapheme counts as one character β including complex sequences:
| Emoji | Counts as |
|---|---|
| π | 1 character |
| ππ½ (skin-tone) | 1 character |
| π¨βπ©βπ§ (family ZWJ sequence) | 1 character |
| πΊπΈ (country flag) | 1 character |
<strong>bold</strong> | 4 characters ("bold") β HTML not counted |
Attached files and image embeds don't count β only visible text contributes to length.
When to set a limit#
| Use case | Suggested limit |
|---|---|
| SMS-style brevity | 160 characters |
| Twitter-style chat | 280 characters |
| Forum-style discussion | 5,000 characters |
| Long-form coaching / consulting messages | 20,000 characters |
| Anti-spam baseline | 10,000 characters (catches dump-style spam) |
| Uncapped (default) | 0 |
How to enable#
Navigate to WP Admin β Better Messages β Settings β Messaging.
- Maximum Message Length β Maximum number of characters allowed (set to
0for no limit)
Frequently asked questions#
Can different roles have different limits?#
Not in the default UI β the setting is a single site-wide cap. Per-role limits are not exposed as a built-in option today; contact support if your site needs that pattern.
What about messages that were already over the limit before I enabled this?#
Pre-existing messages are unaffected β only NEW sends and edits are validated. Editing an old over-limit message would force the user to trim it.
Does the counter handle right-to-left languages correctly?#
Yes β character counting is direction-agnostic. The counter appears in the same place regardless of script direction.
Is the limit shared across the message text and any attached caption?#
The limit applies to the message text only. File attachments and their auto-generated captions don't count.
Can the limit be bypassed via the REST API?#
No β server-side validation rejects over-limit requests. The client UI is convenience; the server is the source of truth.
See also#
- Text formatting β formatted text counts the same as plain
- Markdown support β Markdown syntax is part of the rendered text
- Pre-moderation β hold long suspicious messages for review
- Bad words filter β additional message-content checks

