Spider Slap

This simple module is designed to allow spiders that don't honor robots.txt to block their own IP address. It works by offering anonymous users a small invisible image in a bogus link at the top of the page. Prior to installation the file linked to is disallowed in your robots.txt file.

The bad spiders will try to follow the disallowed link and trigger a rule that will add the offenders IP to the IP Address blocking functionality built into Drupal. The blocked IP will show in the list in Configuration>IP Address Blocking. An email will be sent to the main Drupal admin email address showing the date, time, and IP of the offending spider.

There will also be a watchdog error in the log to help you monitor the performance of Spider Slap.


The only dependencies are the core PHP module and the Rules module which requires Entity tokens. The RobotsTxt module is a handy addition. Installation of Spider Slap creates a rule that does most of the work.


Follow the instructions in the README.txt file included with Spider Slap.


Changes to the Rules written at install will not be available until you disable/uninstall the module and then re-enable it.

Spider Slap 7.x-1.1 seems to have a problem with the latest version of Rules 7.x-2.1. See #1344968 and go to the Rules UI and do a manual Save of the rule that Spider Slap creates. Updating to Spider Slap 7.x-1.2 solves this.

Project Information