The ability to skip hCaptcha verification on the specific form was added for CF7 in v2.9.0, which will be published in days.
Here is the instruction on how to do it.
Hi, thanks for response!
Yes I found this too but don’t got it to work.
How the link should looking like and is the ID of the CF7 right there?
contact-form-7/wp-contact-form-7.php
Best regards
André
Here is the working example how to skip hCaptcha verification for CF7 form with id = 177.
/**
* Filters the protection status of a form.
*
* @param string $value The protection status of a form.
* @param string[] $source The source of the form (plugin, theme, WordPress Core).
* @param int|string $form_id Form id.
*
* @return bool
*/
function hcap_protect_form_filter( $value, $source, $form_id ) {
if ( ! in_array( 'contact-form-7/wp-contact-form-7.php', $source, true ) ) {
// The form is not sourced by CF7 plugin.
return $value;
}
if ( 177 !== (int) $form_id ) {
// The form has id !== 177.
return $value;
}
// Turn off protection for form with id = 177.
return false;
}
add_filter( 'hcap_protect_form', 'hcap_protect_form_filter', 10, 3 );
Thank you. I inserted this code tu Child Themes functions.php but it doesn’t work. ID of the form is 6578.
/**
- Filters the protection status of a form.
*
- @param string $value The protection status of a form.
- @param string[] $source The source of the form (plugin, theme, WordPress Core).
- @param int|string $form_id Form id.
*
- @return bool
*/
function hcap_protect_form_filter( $value, $source, $form_id ) {
if ( ! in_array( ‘contact-form-7/wp-contact-form-7.php’, $source, true ) ) {
// The form is not sourced by CF7 plugin.
return $value;
} if ( 6578 !== (int) $form_id ) {
// The form has id !== 6578.
return $value;
} // Turn off protection for form with id = 6578.
return false;
}
add_filter( ‘hcap_protect_form’, ‘hcap_protect_form_filter’, 10, 3 );
Best regards
As I mentioned above, it is still not released. v2.9.0 will be released in several days.
Today, you can get and build v2.9.0 from GitHub only, using appropriate branch.
Ah okay, thank you very much! Not it works.
Best regards
André