We have a custom registration form on our wordpress website. we are using google recaptcha and input Human question field to stop spam registrations but still the spam registrations won’t stop.

Could anyone suggest what exactly needs to be done?

The Registration form code is as follows.

The JS code has 2 functions one for Recaptcha and another for Validate the “Question field”.

The register submit button is by default disabled and gets enabled only when the recaptcha call backs the function.

function recaptchaCallback() {
  $('#submitBtn').removeAttr('disabled');
}

function validateForm() {
  var a = document.forms["registerform"]["question"].value;
  var b = document.forms["registerform"]["user_login"].value;
  var c = document.forms["registerform"]["user_email"].value;
  if (a == null || a != "5") {
    alert("Bitte f├╝lle alle Felder richtig aus");
    return false;
  }

}
<script src="https://www.google.com/recaptcha/api.js"></script>
<form name="registerform" onsubmit="return validateForm()" method="post">
  <div class="form-group">
    <label style="font-size:18px;">Register</label>
  </div>
  <div class="input-group input-group-md">
    <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
    <input type="text" name="user_login" class=" form-control" placeholder="Username">
  </div>
  <br>
  <div class="input-group input-group-md">
    <span class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></span>
    <input type="email" name="user_email" class="form-control" placeholder="E-Mail">
  </div>
  <br>
  <input type="hidden" name="redirect_to" value="Redirect_URL">
  <div class="input-group input-group-md">
    <span class="input-group-addon"><span class="glyphicon glyphicon-question-sign"></span></span>
    <input type="number" name="question" class="form-control" placeholder="2+3 = ?">
  </div>
  <br>
  <div id="captcha" class="form-group">
    <div class="g-recaptcha" data-sitekey="6LdOGg4TAAAAAJsTt_ZGoK67cyF277uIYwWRxJPW" data-callback="recaptchaCallback"></div>
  </div>
  <div id="pass-info" class="clearfix"></div>
    <button class="btn_full" id="submitBtn" disabled>Register</button>
</form>

The whole thing works fine, Recaptcha and Human question field. When we manually test registerform, we can’t register without accepting the Recaptcha and inserting exactly the value to process the form.

But this is not preventing automatic spam bots which registers on our site.

Is there any other way through which these spam bots are registering ?

Also we disabled “MEMBERS CAN REGISTER” in the admin dashboard.

Are we doing anything wrong?

Thanks in advance for the feedback and suggestions.

Read more here: Stop Spam Registration on our Custom Registration Form


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: