sandywp / plugins / blackhole-bad-bots
Blackhole for Bad Bots
Blackhole is a WordPress security plugin that detects and traps bad bots in a virtual black hole, where they are denied access to your entire site.
Ready in seconds.
v3.8.4 30,000+ installs WP 4.7+ PHP 5.6.20+

What you get inside
2 screens-
Blackhole Settings Screen (showing default options)
-
Blackhole Bad Bots Screen (showing some example bots)
About this plugin
✨ Trap bad bots in a virtual black hole
Important: Do NOT use this plugin on sites with caching. Learn more »
👾 Bye bye bad bots..
Bad bots are the worst. They do all sorts of nasty stuff and waste server resources. The Blackhole plugin helps to stop bad bots and save precious resources for legit visitors.
👾 How does it work?
First the plugin adds a hidden trigger link to the footer of your pages. You then add a line to your robots.txt file that forbids all bots from following the hidden link. Bots that then ignore or disobey your robots rules will crawl the link and fall into the trap. Once trapped, bad bots are denied further access to your WordPress site.
I call it the “one-strike” rule: bots have one chance to obey your site’s robots.txt rule. Failure to comply results in immediate banishment. The best part is that the Blackhole only affects bad bots: human users never see the hidden link, and good bots obey the robots rules in the first place. Win-win! 🙂
✨ Add a blackhole trap to help stop bad bots
Important: Do NOT use this plugin on sites with caching. Learn more »
👾 Features
- Easy to set up
- Squeaky clean code
- Focused and modular
- Lightweight, fast and flexible
- Built with the WordPress API
- Works with other security plugins
- Easy to reset the list of bad bots
- Easy to delete any bot from the list
- Regularly updated and “future proof”
- Blackhole link includes “nofollow” attribute
- Plugin options configurable via settings screen
- Works silently behind the scenes to protect your site
- Whitelists all major search engines to never block
- Focused on flexibility, performance, and security
- Email alerts with WHOIS lookup for blocked bots
- Complete inline documentation via the Help tab
- Provides setting to whitelist any IP addresses
- Customize the message displayed to bad bots 😉
- One-click restore the plugin default options
- Does NOT use or require any .htaccess rules
Blackhole for Bad Bots protects your site against bad bots, spammers, scrapers, scanners, and other automated threats.
✨ Not using WordPress? Check out the standalone PHP version of Blackhole!
👾 Whitelist
By default, this plugin does NOT block any of the major search engines (user agents):
- AOL.com
- Baidu
- Bingbot/MSN
- DuckDuckGo
- Googlebot
- Teoma
- Yahoo!
- Yandex
These search engines (and all of their myriad variations) are whitelisted via user agent. So are a bunch of other “useful” bots. They always are allowed full access to your site, even if they disobey your robots.txt rules. This list can be customized in the plugin settings. For a complete list of whitelisted bots, visit the Help tab in the plugin settings (under “Whitelist Settings”).
✨ Check out Blackhole Pro and level up with advanced features!
👾 Exclusive Pro Features
- Option to disable for logged-in users
- Threshold control (number of allowed hits)
- Custom email alerts
- Custom messages for blocked bots
- Custom redirect for blocked bots
- Custom blackhole trigger links
- Complete inline documentation
- Block bots based on user agent
- Block bots based on IP address
- Whitelist/allow bots by user agent
- Whitelist/allow bots by IP address
- Redirect whitelisted bots
- Set custom HTTP Status Code
- Full-featured Bad Bot Log with paging, sorting, and field search
- Manually add bad bots to the Bad Bot Log
- Geo/IP location lookups for each bad bot
- Logs number of blocked hits for each bot
..plus everything the free version can do and more.
✨ Learn more and get Blackhole Pro »
👾 Privacy
User Data: This plugin automatically blocks bad bots. When bad bots fall into the trap, their IP address, user agent, and other request data are stored in the WP database. No other user data is collected by this plugin. At any time, the administrator may delete all saved data via the plugin settings.
Services: This plugin does not connect to any third-party locations or services.
Cookies: This plugin does not set any cookies.
Credit: Header Image Courtesy NASA/JPL-Caltech.
Blackhole for Bad Bots is developed and maintained by Jeff Starr, 15-year WordPress developer and book author.
👾 Support development
I develop and maintain this free plugin with love for the WordPress community. To show support, you can make a donation or purchase one of my books:
- The Tao of WordPress
- Digging into WordPress
- .htaccess made easy
- WordPress Themes In Depth
- Wizard’s SQL Recipes for WordPress
And/or purchase one of my premium WordPress plugins:
- BBQ Pro – Blazing fast WordPress firewall
- Blackhole Pro – Automatically block bad bots
- Banhammer Pro – Monitor traffic and ban the bad guys
- GA Google Analytics Pro – Connect WordPress to Google Analytics
- Head Meta Pro – Ultimate Meta Tags for WordPress
- REST Pro Tools – Awesome tools for managing the WP REST API
- Simple Ajax Chat Pro – Unlimited chat rooms
- USP Pro – Unlimited front-end forms
Links, tweets and likes also appreciated. Thank you! 🙂
Questions
- Do you offer any other security plugins?
Yes, three of them:
- BBQ Firewall for super-fast firewall security
- Blackhole for Bad Bots to protect your site against bad bots
- Banhammer to monitor and ban any user or IP address
Pro versions with more features available at Plugin Planet.
- How is this plugin different than a firewall?
Blackhole uses its own “smart bot technology” that only blocks bots if they have demonstrated bad behavior. Firewalls typically are “static” and block requests based on a predefined set of patterns. That means that firewalls sometimes block legitimate visitors. Blackhole never blocks regular visitors, and only it blocks bots that disobey your site’s robots.txt rules. So the rate of false positives is close to zero.
- The trigger link is not appearing in the source code?
In order for the plugin to add the trigger link to your pages, your theme must include the template tag,
wp_footer(). This is a recommended tag for all WordPress themes, so your theme should include it. If not, you can either add it yourself or contact the theme developer and ask for help. Here is more information about wp_footer(). Once the footer tag is included, the plugin will be able to add the trigger link to your pages.- Will this block good bots like Google and Bing?
No. Never. All the major search engine bots are whitelisted and will never be blocked. Unless you remove them from the whitelist setting, which is not recommended.
- I think the plugin is blocking Chrome, Firefox, etc.?
Impossible because the plugin never blocks by user agent. It only blocks by IP address. No other criteria are used to block anything.
- How to add bots to the Blackhole manually?
Question: Is it possible to block some bots by just adding them to blocked list and deny them Access to my website?
Answer: Not possible with the free version, but the Pro version includes an easy way to add bots manually (via the Bad Bots Log).
- How do I add other bots to the whitelist?
Visit the plugin settings and add to the list.
- How do I reset the list of blocked bots?
Visit the plugin settings and click the button.
sandywp / also on the shelf
Try another plugin
Akismet Anti-spam: Spam Protection
4.7 · 5M+ installs
The best anti-spam protection to block spam comments and spam in a contact form. The most trusted antispam solution for WordPress…
4.8 · 700K+ installs
Sophisticated antispam plugin for effective daily comment and trackback spam-fighting. Built with data protection and privacy in…
WP Armour – Honeypot Anti Spam
5.0 · 400K+ installs
Fastest growing Anti Spam plugin. No API calls, subscriptions, captcha or puzzle. Full GDPR complaint. For comments, contact…
Spin up a real WordPress site in seconds.
Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.