google recaptcha コンタクトページのみ reCAPTCHA Lite 2024 8月から

Google reCAPTCHA V3 を問い合わせフォームのページのみに表示する方法

Google reCAPTCHA V3で取得したサイトキーとシークレットキーを入力 コンタクトフォーム7

 

function.phpにコードを追加

// お問い合わせページを除き、「reCAPTCHA」を読み込ませない
function load_recaptcha_js() {
if ( ! is_page( array('お問い合わせ','select_by_area'))
// and !is_tax( array('event_big_fes','event_area','event_area'))
// and !is_post_type_archive( 'event_info' )
// and !is_singular('event_info')
) {
wp_deregister_script( 'google-recaptcha' );
}
}
add_action( 'wp_enqueue_scripts', 'load_recaptcha_js',100 );
// お問い合わせページを除き、「reCAPTCHA」を読み込ませない function load_recaptcha_js() { if ( ! is_page( array('お問い合わせ','select_by_area')) // and !is_tax( array('event_big_fes','event_area','event_area')) // and !is_post_type_archive( 'event_info' ) // and !is_singular('event_info') ) { wp_deregister_script( 'google-recaptcha' ); } } add_action( 'wp_enqueue_scripts', 'load_recaptcha_js',100 );
// お問い合わせページを除き、「reCAPTCHA」を読み込ませない
 
function load_recaptcha_js() {
    if ( ! is_page( array('お問い合わせ','select_by_area')) 
    // and !is_tax( array('event_big_fes','event_area','event_area'))
    // and !is_post_type_archive( 'event_info' )
    // and !is_singular('event_info')


    ) {
     wp_deregister_script( 'google-recaptcha' );
    }
   }
   add_action( 'wp_enqueue_scripts', 'load_recaptcha_js',100 );

css

.grecaptcha-badge { visibility: hidden; }
.grecaptcha-badge { visibility: hidden; }
.grecaptcha-badge { visibility: hidden; }

フォームに

<tr>
<th class="mob_none"> </th>
<td>[submit class:event_sub_bt "SUBMIT"]</td>
</tr>
<tr>
<th class="mob_none"> </th>
<td style="font-size: 0.8rem;">Google reCAPTCHA で保護されています
<a href="https://policies.google.com/privacy" rel="noopener noreferrer" target="_blank" >プライバシー</a><a href="https://policies.google.com/terms" rel="noopener noreferrer" target="_blank" >利用規約</a></td>
</tr>
<tr> <th class="mob_none"> </th> <td>[submit class:event_sub_bt "SUBMIT"]</td> </tr> <tr> <th class="mob_none"> </th> <td style="font-size: 0.8rem;">Google reCAPTCHA で保護されています <a href="https://policies.google.com/privacy" rel="noopener noreferrer" target="_blank" >プライバシー</a>・<a href="https://policies.google.com/terms" rel="noopener noreferrer" target="_blank" >利用規約</a></td> </tr>
<tr>
<th class="mob_none"> </th>
<td>[submit class:event_sub_bt "SUBMIT"]</td>
</tr>

<tr>
<th class="mob_none"> </th>
<td style="font-size: 0.8rem;">Google reCAPTCHA で保護されています
<a href="https://policies.google.com/privacy" rel="noopener noreferrer" target="_blank" >プライバシー</a>・<a href="https://policies.google.com/terms" rel="noopener noreferrer" target="_blank" >利用規約</a></td>
</tr>

https://developers.google.com/recaptcha/docs/faq?hl=ja

https://study.graceeight.com/recaptcha-badge

 

https://www.google.com/recaptcha/admin/site/683796841

https://www.google.com/recaptcha/admin/create

 

reCAPTCHA (v3)

 

reCAPTCHA Lite

月1万件の評価

https://zenn.dev/chameleonmeme/articles/0e325a8ea585c8