Title: reCAPTCHA code not working
Last modified: August 30, 2016

---

# reCAPTCHA code not working

 *  Resolved [madu1234](https://wordpress.org/support/users/madu1234/)
 * (@madu1234)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/)
 * After activating google reCAPTCHA and following the WP Tutorial: Adding reCAPTCHA
   to the Job/Resume Submission Form. The reCAPTCHA works fine when you select ARE
   YOU HUMAN BUTTON and also ask for image identification step for authentication.
   Then when you submit the form it shows: The Human Test Field please try again.
 * We have tried everything in resolving the issue but to no avail. Please help 
   with this problem.
 * [https://wordpress.org/plugins/wp-job-manager/](https://wordpress.org/plugins/wp-job-manager/)

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

 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364573)
 * Please post your full code within backticks here (`) so we can see what code 
   you have.
 * Also, let us know what other plugins you’re running, such as field editor.
 *  Thread Starter [madu1234](https://wordpress.org/support/users/madu1234/)
 * (@madu1234)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364707)
 * HI, i used all the same from here
 * [https://wpjobmanager.com/document/tutorial-adding-recaptcha-job-submission-form/](https://wpjobmanager.com/document/tutorial-adding-recaptcha-job-submission-form/)
 * just change the keys.
 * <?php
    // Define your keys here define( ‘RECAPTCHA_SITE_KEY’, ‘XXX’ ); define(‘
   RECAPTCHA_SECRET_KEY’, ‘XXX’ );
 * // Enqueue Google reCAPTCHA scripts
    add_action( ‘wp_enqueue_scripts’, ‘recaptcha_scripts’);
 * function recaptcha_scripts() {
    wp_enqueue_script( ‘recaptcha’, ‘[https://www.google.com/recaptcha/api.js&#8217](https://www.google.com/recaptcha/api.js&#8217););}
 * // Add reCAPTCHA to the job submission form
    add_action( ‘submit_job_form_company_fields_end’,‘
   recaptcha_field’ );
 * function recaptcha_field() {
    ?> <fieldset> <label>Are you human?</label> <div
   class=”field”> <div class=”g-recaptcha” data-sitekey=”<?php echo RECAPTCHA_SITE_KEY;?
   >”></div> </div> </fieldset> <?php }
 * // Validate
    add_filter( ‘submit_job_form_validate_fields’, ‘validate_recaptcha_field’);
 * function validate_recaptcha_field( $success ) {
    $response = wp_remote_get( add_query_arg(
   array( ‘secret’ => RECAPTCHA_SECRET_KEY, ‘response’ => isset( $_POST[‘g-recaptcha-
   response’] ) ? $_POST[‘g-recaptcha-response’] : ”, ‘remoteip’ => isset( $_SERVER[‘
   HTTP_X_FORWARDED_FOR’] ) ? $_SERVER[‘HTTP_X_FORWARDED_FOR’] : $_SERVER[‘REMOTE_ADDR’]),‘
   [https://www.google.com/recaptcha/api/siteverify&#8217](https://www.google.com/recaptcha/api/siteverify&#8217);));
 *  if ( is_wp_error( $response ) || empty( $response[‘body’] ) || ! ( $json = json_decode(
   $response[‘body’] ) ) || ! $json->success ) {
    return new WP_Error( ‘validation-
   error’, ‘”Are you human” check failed. Please try again.’ ); }
 *  return $success;
    }
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364753)
 * Did you change the keys to your own or not?
 *  Thread Starter [madu1234](https://wordpress.org/support/users/madu1234/)
 * (@madu1234)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364754)
 * yes we did change the keys
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364755)
 * Is the exact error shown:
 *     ```
       "Are you human" check failed. Please try again.
       ```
   
 * ?
 *  Thread Starter [madu1234](https://wordpress.org/support/users/madu1234/)
 * (@madu1234)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364756)
 * yes
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364758)
 * Then the API request is failing. 2 possible causes:
 * 1. You put the API keys in wrong
    2. Your server cannot communicate with google
   servers. Host may be blocking the request.
 *  [andyrom](https://wordpress.org/support/users/andyrom/)
 * (@andyrom)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364891)
 * site key and secret key —- would i be correct in thinking we only need to change
   the XXX and leave the rest as is?
 * this is what i have done.
    from the comment above…..seems i have all in place…
   Do you recommend i call my hosting company then?
 *  Plugin Contributor [Adam Heckler](https://wordpress.org/support/users/adamkheckler/)
 * (@adamkheckler)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364902)
 * > site key and secret key —- would i be correct in thinking we only need to change
   > the XXX and leave the rest as is?
 * Correct.
 * > Do you recommend i call my hosting company then?
 * Yeah, they might be able to run some tests to make sure your server can communicate
   with Google, which might be the issue now.
 * Thanks!
 *  [rimoreno](https://wordpress.org/support/users/rimoreno/)
 * (@rimoreno)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364903)
 * i got this very same problem and i checked my keys, i checked my server and everything
   looks good.
 * the only part that i have change on the code is what is in bold due to the fact
   that i use field editor.
 * thanks in advance for your help
 * here is my snippet.
 * ———————————
    Job Manager Recaptcha ———————————— */
 * define( ‘RECAPTCHA_SITE_KEY’, ‘i put in my keys here’ );
    define( ‘RECAPTCHA_SECRET_KEY’,‘
   i put in my keys here’ ); // Enqueue Google reCAPTCHA scripts add_action( ‘wp_enqueue_scripts’,‘
   recaptcha_scripts’ ); function recaptcha_scripts() { wp_enqueue_script( ‘recaptcha’,‘
   [https://www.google.com/recaptcha/api.js&#8217](https://www.google.com/recaptcha/api.js&#8217););}//
   Add reCAPTCHA to the job submission form add_action( ‘submit_job_form_job_fields_end’,‘
   recaptcha_field’ ); function recaptcha_field() { ?> <fieldset> <label>Are you
   human?</label> <div class=”field”> <div class=”g-recaptcha” data-sitekey=”<?php
   echo RECAPTCHA_SITE_KEY; ?>”></div> </div> </fieldset> <?php } // Validate **
   add_filter( ‘submit_job_form_validate_fields’, ‘validate_recaptcha_field’ );**
   function validate_recaptcha_field( $success ) { $response = wp_remote_get( add_query_arg(
   array( ‘secret’ => RECAPTCHA_SECRET_KEY, ‘response’ => isset( $_POST[‘g-recaptcha-
   response’] ) ? $_POST[‘g-recaptcha-response’] : ”, ‘remoteip’ => isset( $_SERVER[‘
   HTTP_X_FORWARDED_FOR’] ) ? $_SERVER[‘HTTP_X_FORWARDED_FOR’] : $_SERVER[‘REMOTE_ADDR’]),‘
   [https://www.google.com/recaptcha/api/siteverify&#8217](https://www.google.com/recaptcha/api/siteverify&#8217);));
   if ( is_wp_error( $response ) || empty( $response[‘body’] ) || ! ( $json = json_decode(
   $response[‘body’] ) ) || ! $json->success ) { return new WP_Error( ‘validation-
   error’, ‘”Are you human” check failed. Please try again.’ ); } return $success;}/*————————————————————————————
   Submit resume ————————————————————————————–*/ add_action( ‘submit_resume_form_resume_fields_end’,‘
   recaptcha_field’ ); add_filter( ‘submit_resume_form_validate_fields’, ‘validate_recaptcha_field’);
 * /*————————————————————————————
    Applications ————————————————————————————–*/ 
   add_action( ‘job_application_form_fields_end’, ‘recaptcha_field’ ); add_filter(‘
   application_form_validate_fields’, ‘validate_recaptcha_field’ );
 *  Plugin Contributor [Adam Heckler](https://wordpress.org/support/users/adamkheckler/)
 * (@adamkheckler)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364904)
 * [@rimoreno](https://wordpress.org/support/users/rimoreno/): Please create your
   own thread per the Forum Welcome policy:
 * [https://codex.wordpress.org/Forum_Welcome#Where_To_Post](https://codex.wordpress.org/Forum_Welcome#Where_To_Post)
 * Thanks!

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

The topic ‘reCAPTCHA code not working’ is closed to new replies.

 * ![](https://ps.w.org/wp-job-manager/assets/icon-256x256.gif?rev=2975257)
 * [WP Job Manager](https://wordpress.org/plugins/wp-job-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-job-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-job-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-job-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-job-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-job-manager/reviews/)

## Tags

 * [job posting](https://wordpress.org/support/topic-tag/job-posting/)

 * 11 replies
 * 5 participants
 * Last reply from: [Adam Heckler](https://wordpress.org/support/users/adamkheckler/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/recaptcha-code-not-working/#post-6364904)
 * Status: resolved