Report Spam comments from WordPress to

The script wp-spamreport.php (as a download here in my git) reports at any time the spam comments of the last 48 hours to

It does not matter when a comment was marked as spam (manually or automatically by example Antispam Bee), but only that the comments are posted in the last 48 hours. The IDs of spam comments will be saved in /tmp/wp-spamreport.ids. If the file does not exist, all the spam comments of the last 48 hours will be transmitted.

Requirement for using the report function is an appropriate account with and an API key.

To use this script just for blocking IPs, set $REPORT = false;.

Download the archive or clone git:
cd /tmp
git clone
cd scripts/blocklist-wp
mkdir -p /root/scripts/firewall
cp * /root/scripts/firewall

The script can be started any time manually using or via cron:
0 * * * * /root/scripts/firewall/ &> /dev/null

Expenditures are logged to syslog (facility Local0). A log entry may look like as follows:
wp-spamreport.php[506094]: [success] reported to (service badbots) from server 2xxx

Leave a comment

Your email address will not be published. Required fields are marked *