user1452114
user1452114

Reputation:

.htaccess Reduce Spam

For reduce spam in wordpress comment i using below code:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*domainname.com* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
</IfModule>

My question is: I want to reduce spam in "signup". The url like this http://www.domain.com/signup

How to change this line:

RewriteCond %{REQUEST_URI} .wp-comments-post\.php*

Become Signup ???

Please help me, thank you.

Upvotes: 0

Views: 391

Answers (2)

Eugene Sutula
Eugene Sutula

Reputation: 1

Simple way to reduce automated spam signups is to use "honeypot" approach - hide one of required fields you have with styles (for example email) so visitors won't see it. Add additional field with some random name. Adjust SocialEngine signup to use new field instead of email. In case hidden email field is filled with some data stop the registration - you got a bot.

(Our team has a simple SocialEngine4 plugin for that called Honeypot)

Upvotes: 0

Peter van der Does
Peter van der Does

Reputation: 14498

The code in .htaccess stops spam by saying:

When accessing the file wp-comments-post.php(which is the file that handles the posting of comments) and the visitor doesn't come from the yourdomain or the user agent of the browser is empty, we can block it.

The reason is that when somebody posts a comment, they have clicked on a button on your site and so the referrer is yourdomain.com

I'm assuming you don't really want this for the page signup as well. People could directly access that page and you want them to sign up.

To reduce spam in signup, it's better to know how the signup works. WordPress doesn't have a page signup, so I'm assuming you are using a 3rd party plugin for signup.

Upvotes: 1

Related Questions