Changing google reCAPTCHA language in contact form 7 – WordPress

There is a function to change the language in google reCAPTCHA. Just add the below code in functions.php and change the language code. See the list of supported language codes here.


add_action( 'wpcf7_enqueue_scripts', 'custom_recaptcha_enqueue_scripts', 11 );
function custom_recaptcha_enqueue_scripts() {
	wp_deregister_script( 'google-recaptcha' );
	$url = 'https://www.google.com/recaptcha/api.js';
	$url = add_query_arg( array(
		'onload' => 'recaptchaCallback',
		'render' => 'explicit',
	 	'hl' => 'fr-CA' ), $url );

	wp_register_script( 'google-recaptcha', $url, array(), '2.0', true );
}