i’m trying this snippet in my .htaccess file
RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} .wp-comments-post\.php* RewriteCond %{HTTP_REFERER} !.*yourdomain.com.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]
this detects when a POST is being made … checks the post destination … checks if the referrer is in your domain or if no referrer (
change yourdomain.com to your domain.xxx) …
sends the spam-bot back to its originating server’s ip address.
lets see if it works
source: https://codex.wordpress.org/Combating_Comment_Spam/Denying_Access
talk
twitter
facebook
whatsapp
signal
feed
print
home → cli.toys → fighting comment spam via .htaccess