Block Searches From Certain IP From Reports

Hi,

Does anyone have any experience in blocking searches from certain IPs from appearing in reports?

I currently, have the below but searches are still coming through?

add_filter(‘relevanssi_ok_to_log’, ‘rlv_block_vuln’, 10, 5);
function rlv_block_vuln($ok, $query, $hits, $user_agent, $ip)
{
if (‘ip.address.here’ === substr($ip, 0, 6)) {
$ok = false;
}
return $ok;
}

Thanks,

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer