• Resolved keshavbhutra

    (@keshavbhutra)


    Hi team,
    How can I disable the new live form preview in Contact Form 7? I want hCaptcha to work on the frontend, but I don’t want any live form preview.
    Thanks in advance.

    • This topic was modified 6 months, 1 week ago by keshavbhutra.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor kaggdesign

    (@kaggdesign)

    Add the following code to your plugin or theme’s functions.php.

    function hcap_cf7( $current_screen ) {
    if ( ! function_exists( 'hcaptcha' ) ) {
    return;
    }

    $hcap_cf7 = hcaptcha()->get( 'HCaptcha\CF7\Admin' );

    if ( ! $hcap_cf7 ) {
    return;
    }

    remove_action( 'current_screen', [ $hcap_cf7, 'current_screen' ] );
    }

    add_action( 'current_screen', 'hcap_cf7', 0 );

    May I know why you consider to remove the live form preview?

    • This reply was modified 6 months, 1 week ago by kaggdesign.
    Thread Starter keshavbhutra

    (@keshavbhutra)

    @kaggdesign

    Thanks for the quick response! The code is working perfectly.

    That said, I don’t really find the preview feature all that useful for Contact Form 7. I’m using Tailwind CSS and usually build my forms with custom HTML and divs.

    Also, it’s a bit annoying that there’s no option to toggle the preview on or off. It takes up half the screen, which I don’t love.

    On top of that, the preview doesn’t reflect the actual styling of the form, which might confuse my clients into thinking the form isn’t designed properly. But on the frontend, everything is styled with global classes and the right fonts.

    To me, the preview feature feels unnecessary. hCaptcha’s spam protection works great with CF7, so I don’t see much value in having a preview window in this case.

    Plugin Contributor kaggdesign

    (@kaggdesign)

    I have added an option to Show/Hide Live CF7 Form in admin. To be released with v4.6.0.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to disable Live Form in Contact Form 7’ is closed to new replies.