I want a code to check if the heartbeat is disabled from a WordPress site or not.


The heartbeat API is essentially a script that is included in your site's head. It performs calls back to the server. So, to disable the heartbeat the script must not be enqueued. And you can check whether a script is enqueued with wp_script_is. Like this:

if (wp_script_is ('heartbeat')) ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.