WordSocket
The official WordPress plugin for the WPSignal realtime event service. Install, connect, and your site starts pushing events to browsers instantly.
Setup
Up and running in less than a minute
No server to provision. No WebSocket infrastructure to manage.
Install and connect
Upload the plugin or install from the WordPress directory. Go to WordSocket > Settings, enter your API key, and click Connect. Credentials are saved automatically.
Events fire on save
Post updates publish instantly without any code. Register custom triggers with the PHP builder to attach realtime events to any WordPress action hook.
Browser receives instantly
The client script connects via WebSocket on page load. Every event fires a native CustomEvent on document. No polling, no framework required.
Features
Everything you need
WebSocket-first
Persistent WebSocket connection with automatic SSE fallback. Channel subscriptions survive the fallback without page reload.
End-to-end encryption
Payloads are encrypted with AES-256-GCM before leaving WordPress. The WPSignal relay forwards ciphertext only and never reads your content.
Fluent trigger builder
Map any WordPress action hook to a realtime event in one PHP call. Add a condition, custom channel, or transform the payload: all optional.
Collaborative editing
On WordPress 7.0+, WordSocket registers as a Yjs WebSocket sync provider for the block editor. Real-time co-editing with no extra setup.
window.WPS API
A public JavaScript API lets themes and plugins subscribe, publish, and listen for events without managing their own WebSocket connection.
Admin explorer
Built-in admin page with live event log, publish form, token inspector, and connection status. Diagnose issues without leaving WordPress.
Developer API
One line of PHP.
Live in the browser.
Register a custom trigger on any WordPress action hook using the fluent builder. The browser receives the event the moment the hook fires.
Listen in JavaScript using window.WPS.on() or
the native document.addEventListener('wpsignal:*') API.
No framework required.
// Register a trigger on any WordPress hook
WPS::trigger('comment.approved')
->on('wp_set_comment_status', 10, 2)
->channel('events')
->data(fn($id, $comment) => [
'author' => $comment->comment_author,
'content' => $comment->comment_content,
])
->when(fn($id, $comment) => $comment->comment_approved === '1')
->register(); // Listen in the browser (window.WPS)
const unsub = WPS.on('comment.approved', (data) => {
console.log('New comment from', data.author);
});
// Or via native DOM events
document.addEventListener('wpsignal:comment.approved', (e) => {
console.log(e.detail.data);
}); FAQ
Common questions
Do I need a WPSignal account?
Yes. WordSocket relays events through the WPSignal server. Create a free account at wpsignal.io, then paste your API key into the plugin settings.
What data leaves my WordPress site?
During registration: your site URL and name. During normal operation: AES-256-GCM encrypted event payloads. The WPSignal server never sees plaintext content. Data is not stored on the server.
Does it work for logged-out visitors?
The built-in client loads for logged-in users by default. Use the wpsignal_allow_client filter to load it for all visitors.
What happens when WebSocket is unavailable?
The client falls back to SSE automatically. Channel subscriptions are replayed on reconnect. Collaborative editing detects the fallback and surfaces a "not synced" status in the block editor.
Does collaborative editing require WordPress 7.0?
Yes. The Yjs sync provider requires @wordpress/sync, which ships in WordPress 7.0. The plugin detects the version and skips registration on older installs.
Get started
Free during beta
Create a free WPSignal account, install WordSocket from the WordPress plugin directory, and connect in under a minute.