Skip to main content
Login Join
Snippet · PHP

Disable Heartbeat API on Dashboard Screens

Shared by Yusuf mudagal · May 3, 2026 · @admin_enqueue_scripts

26 views
Back to Snippets

Stops the WordPress Heartbeat script on dashboard pages where live locking and autosave updates are not needed.

add_action( 'admin_enqueue_scripts', 'wpfolks_disable_dashboard_heartbeat' );

function wpfolks_disable_dashboard_heartbeat( $hook_suffix ) {
    if ( 'index.php' === $hook_suffix ) {
        wp_deregister_script( 'heartbeat' );
    }
}
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments