How to disable Live Form in Contact Form 7

[ad_1]

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 56 minutes ago by kaggdesign.

@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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer