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
  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>
  12. # END die spam die


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.