Block/reduce WordPress spam comments via .htaccess

Akismet key is a useful tool to prevent spam comments, however, it is not a possible solution for every WP site, so another easy (cut n paste) solution is this htaccess snippet that blocks spam comments.
Most spammers attack your site form "wp-comments-post.php", at the same time you prevent extra load on your server.

Paste this code into your .htaccess file.


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post.php*
RewriteCond %{HTTP_REFERER} !.*yourdomainname.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
</IfModule>
Enjoyed this article? Please consider donating: 3FVR5qaxYV8yAgNUUS7FC3o8c54YfDR5zK