Presence API

Description

Presence API gives WordPress a system-wide awareness layer. It tracks which users are logged in, which admin screen they are on, and which posts they are editing.

Data flows through the Heartbeat API and is stored in a dedicated wp_presence table with a 150-second TTL. No writes to wp_postmeta means no post-cache invalidation on every heartbeat.

On a multisite network, Network Admin gets its own view of the same data: a Who’s Online dashboard widget listing the busiest sites and who is on each, an Online column in the Sites list, and an Online view, filter, and column in the Users list. These require the manage_network capability.

Features

  • Admin bar indicator showing who’s online and who’s on this page
  • Active Posts dashboard widget grouped by post
  • Editors column in the post list
  • Online filter in the Users list
  • AI agents labelled in Who’s Online, the admin bar, and the Editors column, once a plugin such as Agent Users marks them

For Developers

PHP functions, REST endpoints, WP-CLI commands, filters, and room conventions are documented in the GitHub repository.

Background

A feature plugin sponsored by the WordPress Core team, exploring what system-wide presence could look like for a future WordPress release. Follow development on make.wordpress.org/core with the tag #presence-api.

Screenshots

Installation

  1. In your WordPress admin, go to Plugins Add New Plugin and search for “Presence API”, then click Install Now.
  2. Activate through the Plugins menu.

Or install manually:

  1. Download the zip and upload the presence-api folder to /wp-content/plugins/.
  2. Activate through the Plugins menu.

FAQ-e

Does it work on multisite?

Yes. Network-activate it and Network Admin gains a Who’s Online dashboard widget listing the busiest sites and who is on each, an Online column in the Sites list, and an Online view, filter, and column in the Users list. Every site keeps its own widgets and lists, counting only the people on that site.

Who can see network-wide presence?

Anyone with the manage_network capability, which on a default network means super admins. The wp_presence_network_capability filter changes what is required.

Can a site stop recording presence?

Yes. Clear the Presence checkbox on Settings > General, or run wp presence recording set off. Every screen empties within one TTL as the rows already stored expire. On multisite, Network Admin > Settings has the same checkbox for every site at once; whichever switch is off decides.

For code, the wp_presence_recording_enabled and wp_presence_network_recording_enabled filters take the checkboxes as their defaults, so a filter always has the last word.

Reviews

There are no reviews for this plugin.

Changelog

Only the most recent releases are listed here. For the full history, see https://github.com/WordPress/presence-api/blob/main/CHANGELOG.md

0.12.2

  • Elect the Heartbeat ping leader per site among visible tabs (#675).
  • Avoid repeated network summary table checks (#657).
  • Read each presence query once per request until the table changes (#678).
  • Trust the presence table’s version option and recheck it only after a failed write (#682).

0.12.1

  • Translate Heartbeat debugger plurals and units (#660).

0.12.0

  • Add an admin bar debugger and remove the Dashboard widget (#652).
  • Label agent presence rows across the admin UI (#653).
  • Let plugins add rows and indicators to the debugger (#666).
  • Give the debugger and DB viewer’s muted text AA contrast (#648).

0.11.0

  • Show presence on every post type edited in the admin (#631).
  • Give presence to roles that edit only pages or a custom post type (#637).
  • Join the post room for what the Site Editor has open (#638).
  • Keep post locks in the presence table with recording off (#644).
  • Name post types, untitled posts and sites in the dashboard widgets (#634).
  • Stop labelling Active Posts as posts being edited (#645).
  • Translate reused core strings under the plugin’s text domain (#646).

0.10.0

  • Fold shared screens into one row in the admin bar menu (#615).
  • List people editing posts first in the admin bar menu (#603).
  • Refresh the Editors column on each heartbeat (#606).
  • Refresh the Online users list on each heartbeat (#604).
  • Show the stale-screen banner on Settings API, Privacy and Network Admin screens (#619).
  • Bump the right Users screen on a row Remove and skip bumps while deleting a site (#628).
  • Link admin bar rows to the comment, user or term being edited (#617).
  • Link Network Admin rows and count the network in the admin bar (#618).
  • Read the network Online view from the heartbeat’s screen (#622).
  • Refresh presence rows on SQLite with CASE instead of IF() (#623).
  • Cut e2e runtime with backdated fixtures and readiness waits (#621).