For each bad bot, Blackhole Pro records a variety of information. Like IP address, User Agent, Request URI, Hostname, and more. In most cases, this extra information is processed quickly with no extra load on the server. But for traffic heavy sites and/or sites hosted on less capable servers, the extra processing may detract from optimal performance.

To help with this, here is a code snippet that you can add to your theme’s functions.php file, or add via simple custom plugin.

// Blackhole Pro - Disable Host Lookup
function blackhole_enable_host_check() { return false; }
add_filter('blackhole_enable_host_check', 'blackhole_enable_host_check');

Once added to your WordPress site, that code instructs Blackhole to skip the expensive query for the hostname lookup. Unfortunately with PHP, looking up the host name is a slow, expensive process that can put extra load on the server.

So the above snippet fixes that by simply disabling the hostname lookup. All of the other bad-bot data will be recorded and displayed as usual, but you’ll see empty/blank values for the “Host” line for each bad bot in the Bad Bots Log.

Bottom Line: Add the above code to disable the expensive hostname lookup for bad bots. Downside: no more host infos in the Bad Bots Log. Upside: lighter load on the server, save resources, etc.