Microsoft Clarity WordPress plugin has a history of causing long page loading times from versions 0.10.5 to 0.10.7. This was fixed on 0.10.8, however a few versions later – in 0.10.10 the problem strikes again.
This time the Microsoft Clarity plugin slows down the WordPress admin side by constantly checking on the latest version of the plugin in each request.
Simple Workaround to fix problem with Microsoft Clarity plugin
Place this code in your WordPress theme functions.php file or add it in a must-use plugin. This code snippet will intercept and block the outgoing “version check” requests made by Microsoft Clarity plugin, therefore returning the loading speeds of the WordPress admin interface back to normal. You can use this safely while Microsoft Clarity plugin developers fixes the problem on their side:
<?php
add_filter('pre_http_request', function($preempt, $args, $url) {
if(strpos($url, 'microsoft-clarity.json') !== false) {
return ['response' => ['code' => 200, 'message' => 'OK']];
}
}, 10, 3);
?>Read more on how to block the outgoing requests in WordPress in order to improve the page loading speeds on your website.