Deny spambots from comments

While denying access to comment spammers may be seen as drastic action, there are ways to prevent access to spammers while still allowing comments to be posted. Adding this to your HTACCESS will help keep bots from posting comments on your wordpress blog, be sure to change yourdomain.com to your website address.

 

 

 

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]

Leave a comment