50% of Hosting for your Website at GoDaddy.com!

Reduce spamming on your wordpress blog using .htaccess

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.

spamming thumb Reduce spamming on your wordpress blog using .htaccess

Here is the code to use in .htaccess:-

RewriteEngine On
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*yourdomainname.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]

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.


One Response to “Reduce spamming on your wordpress blog using .htaccess”

  1. unkn0wn
    August 24, 2012 at 1:18 am #

    Hummm… that’s a pretty solution!

    I’ll try this one :)

    thank you!

Leave a Comment


CommentLuv badge