Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a whois form in my site that enables users to query for domain name availability and if available gives them the option to request for registering it. The whois form is inserted via shortcodes.

My problem is that I want to protect this form from spam bots by hiding the form until the user solves a simple math question or enters a captcha.

I made a lot of research on the internet but found nothing on hiding content for visitors until they prove their humanity. All I found is to hide content for un-logged-in users, which is not my case, because I want to give general visitors (not members) the ability to use the whois form and prevent spam bots at the same time.

Any help or guide lines is greatly appreciated.

Many Many Thanks,

Kri Kab

share|improve this question

1 Answer 1

Well the way I see it have a few options:

1: Use jQuery to .hide() and .show() the form after verification. While user friendly I'm not sure this would deter the bots since the html form will still be visible in your source when 'hidden'

2: Use a separate form that will validate the user input (from captcha or some other service) and then upon proper entry will display the whois form. This could be used to store a cookie or session variable to mark the user as human and let them query the whois form multiple times without revalidating.

3: Add a new required form field to your existing whois form that would serve as user validation and submit it at the time of the Whois request - if it doesn't validate don't submit the request.

Options 2 and 3 would both require some digging around in your code to find where the shortcode is generated and add in the new form fields.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.