Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #1093626

    we all only need the Tool on Page with some Form Elements / contact infos or comments.
    So activating the scripts on all pages is not neccessary – not only on Performance or GDPR reasons.


    Hi Guenter!

    Thank you for using Enfold.

    This should be possible. Please try to edit the framework > php > class-grecaptcha.php file. Replace the “is_recaptcha_active” function with the following code.

      public function is_recaptcha_active() {
                global $post;
                $regex = "!\[av_contact!";
                preg_match( $regex, $post->post_content, $matches );
                $api_vn = $this->api_vn;
                if( $api_vn == '' || ! isset( $matches[0] ) ) {
                    return false;
                $secret_key = $this->get_secret_key();
                $public_key = $this->get_public_key();
                return $public_key && $secret_key;

    Best regards,


    thanks – i test this – but what if i like to use CF7 with it?
    is there a way to only enqueue those things only for those pages.?
    A Friend of mine put me on the right way:

    only change the regex to (and it works great !) :
    $regex = "!\[contact-form-7!"; …

    how to combine both (or maybe the comments pages too) to one hack? ( how is the syntax here on an or relation)
    using just a pipe character in between? ( | )


    And one thing apart: Shouldn’t this be the default behavior?
    On GDPR Reasons we had to avoid Sending of IPs etc. and other infos till the Privacy has been read.

    Then the performance reasons have to be mentioned, because loading a code that is not needed is useless.



    Yes, adding the pipe in between the pattern should work. We’ll forward this to the dev team. Please note that this feature is not intended to work for any other contact forms aside from the default one from the theme.

    Best regards,


    Sorry – can be closed now – i forgot to tell you that i changed the regex code to:

    $regex = "!\[contact-form-7|\[av_contact!";



    No problem. We’ll close this now. @guenter is currently improving the reCAPTCHA script. It will probably be included in the next patch.

    Best regards,

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.