Skip to main content

Realtime Messaging

Better Messages supports two communication modes for delivering messages: AJAX polling and WebSocket.

How it works

In AJAX mode (included in the free version), the plugin periodically sends requests to your server to check for new messages. The polling frequency is configurable — by default, the plugin checks every 3 seconds when a conversation is open and every 10 seconds on other pages. This ensures users receive messages with only a short delay.

The WebSocket version upgrades this to instant delivery using persistent connections. Instead of polling, a live connection is maintained between the browser and the server, so messages appear the moment they are sent — up to 200x faster than AJAX mode. This creates a true real-time chat experience similar to popular messaging apps.

Key capabilities

  • Two communication modes: AJAX polling (free) and WebSocket (premium)
  • Configurable polling intervals for AJAX mode
  • Instant message delivery with WebSocket
  • Automatic reconnection if the connection is interrupted
  • Works across all pages of your website

How to enable

Navigate to WP AdminBetter MessagesSettingsGeneral.

  • Mechanism — Choose between AJAX or WebSocket
  • Thread Interval — How often to check for new messages in an open conversation (default: 3 seconds, AJAX mode only)
  • Site Interval — How often to check for new messages on other pages (default: 10 seconds, AJAX mode only)
tip

The WebSocket version provides the best user experience with instant delivery, lower server load, and additional features like typing indicators and presence status.