By default, when using reCAPTCHA, the theme of the captcha box is set to Light.
You can take a look at the reCAPTCHA Developers Guide from Google if you’d like to change any of the other default attributes.
In the code snippet below we’ll be adding a tag attribute to the
.g-recaptcha div and set a
data-theme tag to have a value of
dark. This is what will change the captcha theme on the form.
1) Enabling reCAPTCHA on your form
First, you’ll need to set up reCAPTCHA to your form. If you need assistance setting this up you can review our full documentation on How to Set Up reCAPTCHA in WPForms.
The code shown below is specifically for the Google Checkbox v2 reCAPTCHA setting that you’ll enable on your form’s Settings » General tab.
Now that reCAPTCHA has been added to your form, you can see what it looks like by default.
Next, you’ll need to add the following code snippet to your site in order to change the captcha theme from Light to Dark.
Once the code has been added to your site, your captcha theme will now be set to Dark.
And that’s it! You’ve successfully changed the captcha theme from Light to Dark. Would you like to change the styling on the form’s placeholder text? Take a look at our article on How to Style Placeholder Text for Form Fields.
Action Reference: wpforms_wp_footer_end