⚡ Target:
functions.php
🔒 Tested: WP 6.6+ / PHP 8.2+
💻 Lang: PHP
The WordPress Heartbeat API sends frequent AJAX requests (/wp-admin/admin-ajax.php) every 15-60 seconds, which can overload CPU on shared and VPS hosting. This snippet disables heartbeat globally except while drafting posts.