Reduce spam on your WordPress blog by using .htaccess


/ Published in: Apache
Save to your folder(s)

Reduce spam on WP installations (comment spam); this snippet does not look for https referers.


Copy this code and paste it in your HTML
  1. # BEGIN die spam die
  2.  
  3. <IfModule mod_rewrite.c>
  4. RewriteEngine On
  5. RewriteCond %{REQUEST_METHOD} POST
  6. RewriteCond %{REQUEST_URI} .wp-comments-post.php*
  7. RewriteCond %{HTTP_REFERER} !.*yourdomainname.* [OR]
  8. RewriteCond %{HTTP_USER_AGENT} ^$
  9. RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
  10. </IfModule>
  11.  
  12. # END die spam die

URL: http://www.wprecipes.com/reduce-spam-on-your-wordpress-blog-by-using-htaccess

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.