• Yesterday I updated the Contact Form 7 to the Version 5.1.1. Today I got SPAM and looking in the configuration I saw that I had to activate reCAPTCHA (v3). So I registered my Domain the way it is explained and got two keys. I installed them on the website using the Integration of Contact Form 7 but after that it was not possible so send information by a form. Everytime I fill in the form and try to send, the form tells that an error occured and that I have to try again later. The forms are working fine, when I disabel the reCAPTCHA key, but then I’m not protected against Spambots. I uninstalled Contact Form an reinstalled it but that didn’t take any effect, enabeling reCAPTCHA (v3) I get errors trying to send a form.

    • This topic was modified 5 years, 10 months ago by djoppl.
    • This topic was modified 5 years, 10 months ago by djoppl.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • I have the same problem (I think). When I check the console I see the following error:

    Invalid site key or not loaded in api.js

    The key is valid for reCaptcha V3, and I also get an error message after trying to send the form.

    This is the full error:

    Uncaught Error: Invalid site key or not loaded in api.js: {REMOVED-KEY-HERE}
    at Object.vP [as execute] (recaptcha__nl.js:516)
    at execute ((index):640)
    at rh (recaptcha__nl.js:508)
    at Rp (recaptcha__nl.js:504)
    at recaptcha__nl.js:518
    at recaptcha__nl.js:537

    I had the same problem. It looks like that the site key has not been sent to API. I have fixed the problem by adding the following code to wp-content/plugins/contact-form-7/modules/recaptcha.php file.

    Add

    <script src=’https://www.google.com/recaptcha/api.js?render=&lt;?php echo esc_js( $service->get_sitekey() ); ?>’></script>

    before the line with code

    <script type=”text/javascript”>

    ( function( grecaptcha, sitekey ) {

    var wpcf7recaptcha = {
    execute: function() {
    grecaptcha.execute(……

    I hope that helps. Please note that this fix might be overwritten with the next plugin update if it’s not included with the next version.

    @ovbpc Thanks, that works, but I had to change the single quote to a double quote for it to work on my website:

    <script src=’https://www.google.com/recaptcha/api.js?render=<?php echo esc_js( $service->get_sitekey() ); ?>’></script>

    To:

    <script src=”https://www.google.com/recaptcha/api.js?render=&lt;?php echo esc_js( $service->get_sitekey() ); ?>”></script>

    @djoppl

    Everytime I fill in the form and try to send, the form tells that an error occured and that I have to try again later.

    See Contact Form 7 5.1.1 – theme needs to properly loads JavaScript in the footer area of each page.

    Switch temporarily (nothing will be lost when you switch back) to a WP default theme to see if the problem goes away.

    If this fixes the problem & you can’t get your theme fixed, you might try <using Contact Form 7 – reCaptcha v2 in addition to Contact Form 7. Once installed and configured it offers the same reCaptcha functionality you are used to in previous versions of Contact Form 7 (recommended by CF7 plugin author).

    @buzztone – thanks, will keep that in mind.

    Hello, we are working on the development of this site, which has a contact form, this we did using Contact Form 7 (5.1.1.) And Contact Form 7 Conditional Fields (1.4.1.), The version of my wordpress is 5.1.1. and we are working on DIVI in its latest version as well.

    It happens that we use Contact Form 7 Conditional Fields, to give the user the option to select a Colombian department and then select one of the sellers of that department, depending on the vendor that is selected, a text message will be sent to his mail, but the form worked well until a week ago, and on Friday we found a flaw, we were carrying out sending tests to each contact of the form but we did not achieve it, because by clicking on send, we get the text “There was a error trying to send your message, please try again later. “, initially showed with red border and now shows it in orange.

    We tried disabling the other plugins that we use on the site, disabling the recaptcha, configuring the recaptcha in V2 and in V3, disabling security plugins, but none of these options worked, the error is still presented.

    This is the code we have in the form:

    <div class=”cont-formulario”>
    <div class=”cont-2col”>
    [text* your-name class:label-form placeholder “Nombre”]
    </div>

    <div class=”cont-2col”>
    [text* Apellido class:label-form placeholder “Apellido”]
    </div>

    <div class=”cont-2col”>
    [email* your-email class:label-form placeholder “Correo electrónico”]
    </div>

    <div class=”cont-2col”>
    [tel* Numero_telefonico class:label-form placeholder “Número Telefónico”]
    </div>

    <div class=”cont-2col”>
    [select* Departamentos class:label-form placeholder “Departamento” “Antioquia” “Atlántico” “Bolívar” “Boyacá” “Caldas” “Cesar” “Chocó” “Córdoba” “Cundinamarca” “La Guajira” “Magdalena” “Putumayo” “Santander” “Sucre” “Tolima” “Valle”]
    </div>

    <div class=”cont-2col”>
    [group Antioquia clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Arbey Vásquez|[email protected]” “Carlos Lopez|[email protected]” “David Vallejo|[email protected]” “Felipe Mariaka|[email protected]” “Julian Tobón|[email protected]”]
    [/group]

    [group Atlantico clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Carlos Guzmán|[email protected]” “Katrina Lux|[email protected]”]
    [/group]

    [group Bolivar clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Carlos Guzmán|[email protected]” “Katrina Lux|[email protected]”]
    [/group]

    [group Boyaca clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Arbey Vásquez|[email protected]” “Carlos Sánchez|[email protected]” “Nelson García|[email protected]”]
    [/group]

    [group Caldas clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Arbey Vásquez|[email protected]”]
    [/group]

    [group Cesar clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Carlos Guzmán|[email protected]”]
    [/group]

    [group Choco clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “David Vallejo|[email protected]” “Felipe Mariaka|[email protected]”]
    [/group]

    [group Cordoba clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Felipe Mariaka|[email protected]”]
    [/group]

    [group Cundinamarca clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Alejandra Rios Gonzalez|[email protected]” “Arbey Vásquez|[email protected]” “Carlos Sánchez|[email protected]” “Jorge Alberto Rincón|[email protected]” “Nelson García|[email protected]” “Paola Lozada|[email protected]”]
    [/group]

    [group La_Guajira clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Carlos Guzmán|[email protected]”]
    [/group]

    [group Magdalena clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Carlos Guzmán|[email protected]” “Katrina Lux|[email protected]”]
    [/group]

    [group Putumayo clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Nelson García|[email protected]”]
    [/group]

    [group Santander clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Arbey Vásquez|[email protected]”]
    [/group]

    [group Sucre clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Carlos Guzmán|[email protected]” “Felipe Mariaka|[email protected]”]
    [/group]

    [group Tolima clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Carlos Sánchez|[email protected]”]
    [/group]

    [group Opcion_Valle clear_on_hide]
    [select* destinatario class:label-form placeholder “Asesor” “Ana Piedrahíta|[email protected]”]
    [/group]

    </div>
    <div class=”cont-1col”>
    [text* your-subject class:label-form-ancho placeholder “Asunto”]
    [textarea* your-message class:label-form-ancho class:label-mensaje placeholder “Escriba su mensaje aquí”]
    </div>

    <div class=”boton”>
    [submit class:boton-enviar “ENVIAR”]
    </div>
    </div>

    and this is the error that marks me from console:

    recaptcha__es.js:513 Uncaught Error: Invalid site key or not loaded in api.js: 6LfehpwUAAAAAK-JTX4XR_thiuHexKmSYAqx_FRq
    at Object.JL [as execute] (recaptcha__es.js:513)
    at HTMLDocument.execute ((index):1236)
    at Object.wpcf7.triggerEvent (scripts.js?ver=91a57136b42b55f27af4637c03ffcb70:367)
    at ajaxSuccess (scripts.js?ver=91a57136b42b55f27af4637c03ffcb70:298)
    at Object.<anonymous> (scripts.js?ver=91a57136b42b55f27af4637c03ffcb70:350)
    at i (jquery.js?ver=1.12.4:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
    at y (jquery.js?ver=1.12.4:4)
    at XMLHttpRequest.c (jquery.js?ver=1.12.4:4)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Not able to send forms when reCAPTCHA v3 is active’ is closed to new replies.