Spam bots mostly access your wp-comments-post.php directly to spam on wordpress blog, and controlling the direct access to wp-comments-post.php using .htaccess can stop spam bots to spam on your wordpress. Although Akismet helps a lot to reduce spamming, however using .htaccess is also a good idea to reduce spams.
Here is the code to use in .htaccess:-
<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> |
Replace yourdomainname with your domain name, Save file and spam bots will no longer able to access wp-comments-post.php directly which will significantly reduce number of spams.




→
Hummm… that’s a pretty solution!
I’ll try this one
thank you!