Report Spam comments from WordPress to blocklist.de


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 blocklist.de.

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 blocklist.de and an API key.

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

Installation:
Download the archive or clone git:
cd /tmp
git clone https://git.schaal-it.com/scripts/scripts.git
cd scripts/blocklist-wp
mkdir -p /root/scripts/firewall
cp * /root/scripts/firewall

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

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

Leave a comment

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