Title: Forms can be submitted without completing captcha
Last modified: June 5, 2024

---

# Forms can be submitted without completing captcha

 *  Resolved [Chris Hardie](https://wordpress.org/support/users/chrishardie/)
 * (@chrishardie)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/forms-can-be-submitted-without-completing-captcha/)
 * hCaptcha is installed with a key configured, the site config checks out, and 
   the captcha displays successfully on the page. But forms can still be submitted
   without checking the box or completing a captcha puzzle. We’ve tried this with
   and without the “force” setting enabled, but for the most part forms can still
   be submitted without any interaction with the captcha box. We’re not seeing any
   console/JS errors. Is there an additional setup step needed?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fforms-can-be-submitted-without-completing-captcha%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Contributor [kaggdesign](https://wordpress.org/support/users/kaggdesign/)
 * (@kaggdesign)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/forms-can-be-submitted-without-completing-captcha/#post-17807385)
 * With pure WooCommerce, hCaptcha works properly. On your page, you have a non-
   standard WC Register form, with First Name and Last Name fields added. The form
   is sending correctly, with hCaptcha field, but it is not verified on the backend.
 * Could you temporary deactivate plugins one by one (except WC and hCaptcha ) and
   see when hCaptcha starts works properly? Knowing which plugin is a culprit will
   help to debug the case and add compatibility with that plugin.
 * Thank you.
 *  Thread Starter [Chris Hardie](https://wordpress.org/support/users/chrishardie/)
 * (@chrishardie)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/forms-can-be-submitted-without-completing-captcha/#post-17807442)
 * The name fields are custom to our theme, but we do have validation logic in place
   for those. And the issue is happening on the lost password page where there are
   no custom fields, not just the registration form, so it seems like something 
   else is going on.
 * If we need to add additional logic to our validation function to support hCaptcha,
   could you let me know what that should look like?
 * Here’s how we call the validation function:
 * `add_filter( 'woocommerce_process_registration_errors', array( $this, 'wwn_validate_account_fields'));`
 * and the validation function itself is essentially:
 *     ```wp-block-code
       public function wwn_validate_account_fields( WP_Error $errors ): WP_Error {
       	if ( wp_verify_nonce( sanitize_key( $_POST['woocommerce-register-nonce'] ), 'woocommerce-register' ) ) {
       		foreach ( $this->extra_fields as $name => $field ) {
                               // perform validation
       		}
       	} else {
       		return new WP_Error( 'nonce_verification_failed', __( 'Nonce verification failed', 'our-text-domain' ) );
       	}
       	return $errors;
       }
       ```
   
 * Thank you.
 *  Plugin Contributor [kaggdesign](https://wordpress.org/support/users/kaggdesign/)
 * (@kaggdesign)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/forms-can-be-submitted-without-completing-captcha/#post-17807506)
 * What do you return after // perform validation?
 * Please refer to [this filter](https://github.com/hCaptcha/hcaptcha-wordpress-plugin/blob/aa580b1c05ee0aff974fbf1d99e92341a6f82094/src/php/WC/Register.php#L68).
   It should fire earlier than your filter in the theme. And it looks like your 
   code overrides the result of the above mentioned filter.
 * Could you debug the execution of these two filters and share the results?
 *  Plugin Contributor [kaggdesign](https://wordpress.org/support/users/kaggdesign/)
 * (@kaggdesign)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/forms-can-be-submitted-without-completing-captcha/#post-17807654)
 * I have fixed the issue on my end. Please install new version 4.2.1.
 * Thank you for the reporting.
 *  Thread Starter [Chris Hardie](https://wordpress.org/support/users/chrishardie/)
 * (@chrishardie)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/forms-can-be-submitted-without-completing-captcha/#post-17807761)
 * That appears to have fixed it – thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Forms can be submitted without completing captcha’ is closed to new replies.

 * ![](https://ps.w.org/hcaptcha-for-forms-and-more/assets/icon.svg?rev=3026321)
 * [hCaptcha for WP](https://wordpress.org/plugins/hcaptcha-for-forms-and-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hcaptcha-for-forms-and-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hcaptcha-for-forms-and-more/)
 * [Active Topics](https://wordpress.org/support/plugin/hcaptcha-for-forms-and-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hcaptcha-for-forms-and-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hcaptcha-for-forms-and-more/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Chris Hardie](https://wordpress.org/support/users/chrishardie/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/forms-can-be-submitted-without-completing-captcha/#post-17807761)
 * Status: resolved