• Hi, is there an easy way to add Google reCAPTCHA to Essential Form?
    I have tested the plugin yet, I thought I asked first.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jose

    (@giuse)

    Hi @rawdolphe,

    no, there is no simple way to do that. This contact form is for who wants just a contact form with the fields: name, email, message, and agreement checkbox, and nothing else.
    The plugin already has an anti-spam system that runs behind the scenes and you don’t need any reCAPTCHA.

    This plugin doesn’t give you many possibilities. This is why it’s very light.
    If you need reCAPTCHA in a easy way maybe better you use a different contact form plugin.

    However, adding reCAPTCHA like many other things is possible, but only if you write your custom code.

    For adding the reCAPTCHA you can use the filter ‘essential_form_after_checkbox’ to add the custom hidden fields needed by the reCAPTCHA.

    You will have something that looks like:

    add_filter( 'essential_form_after_checkbox', function( $output, $post, $settings, $atts ) {
        $custom_fields = '<input ....>';
        return $output . $custom_fields;
    }, 10, 4 );

    You will need to add your custom field also to the Essential Form allowed fields by filtering ”essential_form_fields_array’.
    You will need something that looks like:

    add_filter( 'essential_form_fields_array', function( $fields ) {
       $fields[] = 'your_field_name';
       return $fields;
    } );

    Then with the action ‘essential_form_before_sending’ you can add your custom code to validate the user.
    You will have something that looks like:

    add_action( 'essential_form_before_sending', function( $name,$email,$message,$post_id ) {
       // Here you will need to get the data from the global variable $_POST and use them to validate the user
    // If the user is not validated, then you can just stop the PHP execution, and no email will be sent, e.g. if( ....) { die() };
    
    } );

    This was just for giving you an idea and the direction. Never tested a reCAPTCHA, and I can’t help more on this.

    Honestly, if I wanted a reCAPTCHA I would prefer a different contact form plugin that already integrates a reCAPTCHA.

    As said, this plugin doesn’t need any reCAPTCHA because its inbuilt anti-spam system works behind the scenes, and most of all, it works.

    I hope it helps.

    Have a great day!

    Jose

    Thread Starter Gin

    (@rawdolphe)

    Hi Jose,

    Thank you for your reply and the code snippets, much appreicatted.

    Lately I was using Elementor with their native built-in contact form, and there was some spam protection; I was still receiving spam and decided to use reCAPTCHA v3, and it worked great.

    I don’t know much about the ‘spam industry’, couldn’t tell if they were bots or real humans though!

    I think I will give your contact form plugin a try, at the moment I am testing it locally and managed to style the button. Will definitely leave positive rating if I end up using it live.

    A couple of suggestion / feedback:
    1) As I am testing Gutenberg blocks with the latest 2024 WP theme, when you insert the shortcode on the page you don’t see the form, so it’s not ideal for styling in the backend.

    2) Maybe the button could inherits the style from the theme, so we don’t need to add extra css?

    3) Not sure if this is straight forward, but maybe an option to reject links, url/http… with an error popping saying that their not allowed in the form if they submit.

    Otherwise, your super light contact form is a really great idea and will be much appreciated by many I believe. I am 99% sure that I will be using it ??

    Thread Starter Gin

    (@rawdolphe)

    Hi Jose,

    Some updates ??

    Previously I was testing Essential Form with 2024 when I first posted; now I am moving to GeneratePress + Blocks, and now your form has a much better formatting; button and padding look good. Great!

    A last suggestion, it would be good to have some integration with MailChimp, maybe by adding/showing another tick box at the front end next to the terms agreement; subscribe to ours news letter or something… I understand that this will add extra weight and complexity to the script and it might defeat the object?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘ReCAPTCHA’ is closed to new replies.