Below is the code to deactivate WordPress Heartbeat API.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Deactivate WordPress Heartbeart API | |
function stop_heartbeat() { | |
wp_deregister_script('heartbeat'); | |
} | |
add_action('init', 'stop_heartbeat', 1); |
Alternatively, if you don’t want to deactivate WordPress Heartbeat API but prefer to limit it, then you can download and install Heartbeat Control from the WordPress Plugin Repository.