Advertisement
keha76

WordPress | Block Spam Bots With No Referrer | htaccess

Mar 12th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Protect from spam bots
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine On
  4. RewriteCond %{REQUEST_METHOD} POST
  5. RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
  6. RewriteCond %{HTTP_REFERER} !.yourwebsite.com.* [OR]
  7. RewriteCond %{HTTP_USER_AGENT} ^$
  8. RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
  9. </IfModule>
  10.  
  11. # http://www.mastermindblogger.com/2011/5-simple-tricks-to-prevent-wordpress-spam-comments/
  12. # Saved here to keep it accessible to myself.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement