1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to remove spam prevention questions from Contact Us form?

Discussion in 'Styling and Customization Questions' started by sforum, Oct 5, 2012.

  1. sforum

    sforum Active Member

    I want to use the Contact Us form so that people can contact me about advertising enquiries. However, this shows the "Question & Answer CAPTCHA" by default for guests, and I would rather it didn't.

    Is there any way I can remove the Question & Answer CAPTCHA from the Contact Us form? I tried commenting out the following from the contact template:

    Code:
    <xen:include template="helper_captcha_unit" />
    
    ...but this simply hides the captcha, so when you try to submit the form it gives an error about not answering the captcha question correctly!
    Basically, I want guests to be able to email me, from a Contact Us style form, without having to deal with a captcha of any kind. Is that possible?
    Thanks. :)
     
  2. surfsup

    surfsup Well-Known Member

    Are you sure you want to remove that feature.....you would get tons of spam imo ....
     
  3. Arty

    Arty Well-Known Member

    Extend class XenForo_ControllerPublic_Misc (create listener for load_class_controller code event), copy function actionContact from original class and remove these lines from function:
    Code:
                if (!XenForo_Captcha_Abstract::validateDefault($this->_input))
                {
                    return $this->responseCaptchaFailed();
                }
    
    and
    Code:
                    'captcha' => XenForo_Captcha_Abstract::createDefault()
    
    Or remove those lines from function actionContact in library/XenForo/ControllerPublic/Misc.php if its easier for you than creating add-on.
     
    sforum and Jake Bunce like this.
  4. sforum

    sforum Active Member

    Thanks Arty, but having slept on it...

    ...I think I'll just change the captcha question(s) to something less confusing and leave it as it is!

    Thanks very much for your help anyway. :)
     
  5. Tracy Perry

    Tracy Perry Well-Known Member

    It's a pity that if you use something like "Are You Human" or KeyCaptcha it doesn't work... even following the instructions to remove the string as instructed at KeyCaptcha.com. I wish there was a way that you could use (just for the Contact Us and Lost Password) one of the other captcha routines. Best of both worlds.
    Barring that, just removing the ability for guests not to see the "Contact Us" would work.
     

Share This Page