• Resolved Jordy8

    (@jordy8)


    If I enable Google Recaptcha on my website, it will be loaded on every single page. Usually it is only needed on login/signup pages and pages with a comment form. Is there any way to achieve this? It would improve the performance of all other pages quite a lot!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support vupdraft

    (@vupdraft)

    For your contact forms, what are you using e.g contact forms 7?

    Thread Starter Jordy8

    (@jordy8)

    No I am using Elementor and their built-in forms. They also have their own Recaptcha integration so that’s fine.

    My main question for AIOWPS is to only include the recaptcha javascript on login/sign-up pages and pages with a Comment form because that’s the only place where Recaptcha is shown. On the homepage, for example, it’s not needed.

    Plugin Support vupdraft

    (@vupdraft)

    You could try something like this to remove the Google script from loading on unwanted pages, You would need to add it to child theme’s functions.php

    //Remove Google ReCaptcha code/badge everywhere apart from select pages
    add_action(‘wp_print_scripts’, function () {
    //Add pages you want to allow to array
    if ( !is_page( array( ‘contact’,’some-other-page-with-form’ ) ) ){
    wp_dequeue_script( ‘google-recaptcha’ );
    //wp_dequeue_script( ‘google-invisible-recaptcha’ );
    }
    });

    Thread Starter Jordy8

    (@jordy8)

    Thank you! It doesn’t work, unfortunately, because the google-recaptcha script isn’t part of the queue. So deregistering doesn’t do anything; it’s still loading.

    Plugin Support vupdraft

    (@vupdraft)

    Can you check with Elementor? AIOWPS only normally loads Captcha on login forms.
    If you disable the Captcha in Brute force>>Captcha login, do you still experience the issues?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Load Recaptcha only when needed’ is closed to new replies.