// reCAPTCHA のスクリプトをお問い合わせページ以外で無効化 function load_recaptcha_js() { if ( ! is_page( 'contact' ) ) { wp_dequeue_script( 'google-recaptcha' ); wp_deregister_script( 'google-recaptcha' ); } } add_action( 'wp_print_scripts', 'load_recaptcha_js', 100 );