Black Hole for Craft CMS

Free · no editions, no licensing code

Bad bots tell you what they are

You cannot block a scraper by its user agent, because a user agent is a string it picked. You can block it for what it did. Black Hole puts one path off limits in robots.txt, points an invisible link at that path, and blocks by address anything that follows the link anyway.

Black Hole

Two commands, then nothing

Install it, let it write the robots.txt directives, and the hidden link is already on every front-end page. There is no third step.

bash
composer require justinholtweb/craft-blackhole
php craft plugin/install blackhole

# The one thing the plugin cannot do for you:
php craft blackhole/robots/write

# Black Hole for bad bots — do not remove
# User-agent: *
# Disallow: /blackhole

Features

Everything the WordPress original charges for, and the verification it does not do.

A link no reader can reach

Hidden, nofollow, aria-hidden and untabbable, spliced in before the last closing body tag — or placed wherever you want it with one Twig tag.

  • A screen reader never announces it
  • A keyboard user cannot tab into it

Blocked before routing

One indexed ban lookup at EVENT_BEFORE_REQUEST. A banned address gets a status code and a message — no templates rendered, no queries, no session started.

  • The session is never touched until a ban is certain
  • The check fails open; it cannot take a site down

A spoofed Googlebot does not walk through

Crawlers claiming a name that publishes reverse DNS are made to prove it — address to hostname, hostname to the operator's domain, and back to the same address.

  • Anyone can point a PTR record at googlebot.com
  • Nobody can make Google's own DNS agree

Allowlists that understand addresses

Exact addresses, dotted prefixes and CIDR ranges, IPv4 and IPv6 alike, compared on packed bytes — plus about forty crawler user agents out of the box.

  • 2001:db8::1 and its expanded form are the same address
  • Logged-in users and the control panel are never caught

A ledger, not a log file

One row per address — filterable, searchable, sortable — opening onto hostname, user agent, referrer, what it asked for and its whole request history.

  • Release, whitelist, delete, or block an address by hand
  • Every command the control panel has, the console has too

Yours to tune

Trip thresholds, ban lengths, a custom trap path, your own blocked and caught templates, an off-site redirect, email alerts and a retention window.

  • All of it free — there is no paid tier to upgrade to
  • Alerts latch per address, so a flood cannot flood your inbox

Frequently Asked Questions

The questions worth answering before you install it.

Put one path off limits and see who ignores it

Free, for Craft CMS 5.3 and later. Install it, run one command, and the trap is live on every page.