Limit Heartbeat API in WordPres

One of the most common WordPress issues in high traffic websites that causes overload is WordPress Heartbeat API. Copy this code in your functions.php to limit it.