reCaptcha 3 also for contact form in Footer

Hi,
I am using reCAPTCHA (v3) with the forms “Contact Form 7”. e.g. on the page https://www.dk-institut.de/mystery-shopper/
I also added the following code to functions.php in my child theme, so the reCaptche logo only shows on those pages where it is actually used:
function cf7_dequeue_scripts() {
$load_scripts = false;
if( is_singular() ) {
$post = get_post();
if( has_shortcode($post->post_content, ‘contact-form-7’) ) {
*$load_scripts = true; *
}
}
if( ! $load_scripts ) {
wp_dequeue_script( ‘contact-form-7’ );
wp_dequeue_script(‘google-recaptcha’);
*wp_dequeue_style( ‘contact-form-7’ ); *
}
}
add_action( ‘wp_enqueue_scripts’, ‘cf7_dequeue_scripts’, 99 );

This seems to work correctly, besides the logo does not show on the homepage even to there is the contact form activated in “extra options” - “Footer contact”. Since I also us a “Contact Form 7” form for this, it should automatiaclly use reCaptcha as well, correct?
But somehow it does not show the logo on that page:


What do I need to change?
Thanks, Martina

Hello Martina,

Have you checked this guide?

Regards,
Kharis

Yes I did. And it’s already configured.
As you can see it works for the forms https://www.dk-institut.de/karriere/jobs/, https://www.dk-institut.de/mystery-shopper/ and https://www.dk-institut.de/karriere/das-deutsche-kundenpanel/. The recaptcha logo shows up in the lower right corner.
But on the homepage it does not:https://www.dk-institut.de/
Even though I am also using a contact-form-7 here. I am using the form in “Extra options” -> “Footer contact”.
Is there something else I need to do in order for the recaptcha to work in this section?
Thanks, Martina

Hello there,

Thank you for adding more detailed information. Please provide me a screenshot to your contact form setting and point me where you put that reCaptcha.

Regards,
Kharis

Here are the screenshots:



Is this what you meant?

And I just tested. The footer contact form does not even work. Just tried to send a message. I assume this is the reason the captcha logo does not show up.
Are there any setting in the footer I need to set in addition?
If I use a different form in this footer section, that works well on other pages e.g. the form on https://www.dk-institut.de/mystery-shopper/ , it does not work here either!

Thanks, Martina

Hello Martina,

What does your Contact Form 7 (ID: 898)'s configurations look like? Have you properly integrated the reCAPTCHA into it?

Regards,
Kharis

Hi Kharis,
as I said above - the problem does not seem to be the reCAPTCHA. It’s the contact form in the footer. If I use the Contact Form 7 (ID: 898) in the contact footer: [contact-form-7 id=“898” title=“Contact footer”] on the home page: https://www.dk-institut.de/ it does not wortk at all! You can test, you receive an error message when sending.
IF I use the same form id=“898” on a test page https://www.dk-institut.de/test-kontakt/ it does work. (and the reCaptcha logo shoes up.

So the rreCaptcha is configured correctly. But the form (or any form) that works on all pages does not work in the section “Extra options” -> “Footer contact”.

And if you look at the screenshot I sent above it looks like I configured everything I can in the footer contact section???

Thanks, Martina