Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Turn off the Heartbeat API on the public site

Stops WordPress’s Heartbeat requests on the public site, where nothing needs them. The editor keeps its autosave and post locks.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Performance
  • Tested with WordPress 7.1
PHP
<?php

add_action(
	'init',
	static function () {
		if ( ! is_admin() ) {
			wp_deregister_script( 'heartbeat' );
		}
	},
	1
);

Good to know

Plugins that use Heartbeat on the front end (some live chat or booking plugins) stop updating in real time.

In these packs

  • More speed: More ways to load less: block styles, speculative loading, fewer scripts.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.