HTACCESS Deny Spambots from your WordPress comments


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

Block automated spam bots from hitting your WordPress wp-comments-post.php file.


Copy this code and paste it in your HTML
  1. RewriteEngine On
  2. RewriteCond %{REQUEST_METHOD} POST
  3. RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
  4. RewriteCond %{HTTP_REFERER} !.*yourdomain.com.* [OR]
  5. RewriteCond %{HTTP_USER_AGENT} ^$
  6. RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.