Viewing 1 replies (of 1 total)
  • Hi @ildomandatore

    We need to load external scripts from Google reCAPTCHA to make it work. It is hooked in a way that reCAPTCHA works on all pages.

    However, you can remove JS and Style added by this plugin from pages where you do not want to add reCAPTCHA. You can use the following lines of code to do so.

    function agr_dequeue_script() {
    
      if( !is_page( array( 'about-us', 'contact-us' ) ) ){
        
        //remove scripts
        wp_dequeue_script( 'advanced-google-recaptcha-custom' );
        wp_dequeue_script( 'advanced-google-recaptcha-api' );
    
        //remove style
        wp_dequeue_style( 'advanced-google-recaptcha-style' );
      }
    
    }
    
    add_action( 'wp_enqueue_scripts', 'agr_dequeue_script', 100 );

    You can add this line of code to?functions.php?of your theme.

    Note?!is_page?in the code above. It will remove scripts from all the pages excluding pages you provide in the array.

    Please let us know if you need further help.

Viewing 1 replies (of 1 total)
  • The topic ‘Your Recaptcha plugin slows website’ is closed to new replies.