Blackhole Pro automatically detects, traps, and blocks bad bots. There are some cases, however, where you may want to always allow access for a particular bot or IP address. This may come in handy for testing purposes, proxy servers, caching plugins, and so forth. This quick tutorial explains how to whitelist with Blackhole Pro.
Whitelist bots by User Agent
By default, Blackhole Pro blocks bad bots via their reported IP address. To whitelist a bot by its reported user agent, visit the plugin setting “Whitelisted Bots”. There you can enter any strings that should never be blocked. That way you will never block important things like Google, et al. Note: any strings entered here will be matched against the user agent via regular expression. Separate multiple strings with commas.
Important: The default for this setting ensures that the main search engines are never blocked, so be careful with the default strings:
adsbot-google, aolbuild, apis-google, baidu, bingbot, bingpreview, butterfly, cloudflare, duckduckgo, embedly, facebookexternalhit, facebot, googlebot, ia_archiver, linkedinbot, mediapartners-google, msnbot, netcraftsurvey, outbrain, pinterest, quora, rogerbot, showyoubot, slackbot, slurp, sogou, teoma, tweetmemebot, twitterbot, urlresolver, vkshare, w3c_validator, wordpress, wprocketbot, yandex
Don’t mess with any of these strings unless you are 100% sure that you know what you are doing.
Whitelist bots by IP Address
To whitelist specific bots by their reported IP address, visit the setting “Whitelisted IPs”, and enter the IPs that you would like to always allow access. Any IPs entered in this setting will be matched against the reported IP address via regular expression. So you can block entire ranges of IPs by adding something like
173.203.204. Separate multiple IP/strings with commas. For more information, check out the article on whitelisting plugins. By default, Blackhole Pro whitelists the following IP addresses:
- The admin’s server IP address
- The admin’s local IP address
- Securi Sitecheck IP addresses
- WP Rocket IP addresses
Redirecting whitelisted bots
Along with the other whitelist settings, there also is an option to specify a custom URL to which all whitelisted bots will be redirected. Normally whitelisted bots can access and surf around your site just like any other visitor. This setting enables you to redirect all bots in your user-agent or IP-address whitelists. Important: recommended to leave this setting blank unless you know what you are doing.