---
title: "WordSocket"
description: "The WordPress plugin for WPSignal: triggers on action hooks, an encrypted blind relay, a browser client on window.WPS, and a Yjs provider for Gutenberg real-time collaboration."
url: https://wpsignal.io/wordsocket/
---

WordPress Plugin · v0.28.0

The official WordPress plugin for the WPSignal realtime event service. Install, connect, and your site starts pushing events to browsers instantly. No polling. No server to manage.

-   WP 6.7+
-   PHP 8.2+
-   Tested up to WP 7.1
-   GPL-2.0

[Install from WordPress.org](https://wordpress.org/plugins/wordsocket/) [Get started](https://api.wpsignal.io/dashboard/signup)

## Up and running in less than a minute

No server to provision. No WebSocket infrastructure to manage.

1.  ### 1. Install and connect

    Upload the plugin or install from the WordPress directory. Go to WP Admin > WordSocket and click Connect.

2.  ### 2. 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.

3.  ### 3. 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.

Need a visual guide? Watch this 1min [demo](https://www.youtube.com/watch?v=yS1roK49HEQ)

## 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 with `window.WPS.on()` or the native `document.addEventListener('wpsignal:*')` API. No framework required.

```php
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();
```

```js
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.data);
});
```

## Built for WordPress developers

-   ### Blind relay encryption

    Event payloads are encrypted with AES-256-GCM before they leave WordPress, on HTTPS and plain HTTP sites alike, so the relay forwards ciphertext it cannot read.

-   ### 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.

-   ### 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.

## 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: event payloads, AES-256-GCM encrypted before they leave WordPress on HTTPS and plain HTTP sites alike, so the WPSignal server never sees their plaintext. When real-time collaboration is enabled, Yjs document updates are also relayed; these are not encrypted, so the server could read them, though it only forwards them and never parses or stores them. 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 needs WebSocket, because SSE is receive-only. If the editor opens while the client is on SSE, collaboration stays off for that editor until the page is reloaded with WebSocket available.

Does collaborative editing require the Gutenberg plugin?

Yes, for now. Real-time collaboration was removed from WordPress core before the 7.0 release and currently ships with the Gutenberg plugin. WordSocket detects when it is available and enabled, and skips registration otherwise.

## Exclusive Access

Create a WPSignal account, install WordSocket from the WordPress plugin directory, and connect in under a minute.

[Create an account](https://api.wpsignal.iohttps://api.wpsignal.io/dashboard/signup) [View on WordPress.org](https://wordpress.org/plugins/wordsocket/)
