How to Change Google reCAPTCHA Language Settings

Would you like to customize the language of Google’s v2 reCAPTCHA on your forms? While Google attempts to auto-detect your page’s language, sometimes you may need to manually set it.

This guide will show you how to set a specific language for your reCAPTCHA using a simple code snippet.

Requirements:

Setting the Language

To set a specific language for your reCAPTCHA, add this code to your site. For help adding code snippets, please see this tutorial on adding custom PHP or JavaScript.

This code works by:

  1. Intercepting the reCAPTCHA URL before it loads
  2. Adding the language parameter (‘hl’) with your specified language code
  3. Returning the modified URL with proper escaping for security

‘hl’ is Google’s parameter for setting the language (stands for “host language”), and ‘fr’ is the language code for French.

To use a different language:

  1. On line 10, replace ‘fr‘ with your desired language code
  2. Find your language code in Google’s documentation on reCAPTCHA Language Codes

After adding the code, the reCAPTCHA text (like “I’m not a robot“) will appear in your chosen language.

Multi-Language Support

For sites using WPML, you can use this alternative code that automatically matches your WPML language settings:

And that’s all you need to force the reCAPTCHA language. Would you like to also change the look of reCAPTCHA? Take a look at our article on How to Change the Captcha Theme on Google Checkbox v2 reCAPTCHA.

Reference Filter

wpforms_frontend_recaptcha_url