<html lang="pt-br" dir="ltr"><head></head><body>### [wpforms_frontend_captcha_api](https://wpforms.com/developers/wpforms_frontend_captcha_api/)

**Published:** September 30, 2025
**Author:** Umair Majeed

**Content:**

## Description

The `wpforms_frontend_captcha_api` filter lets you change the URL used to load the CAPTCHA script on the frontend. This is commonly used to swap the default Google reCAPTCHA URL with an alternate domain.

Use this filter to point reCAPTCHA to a different host if the default domain is blocked in your region or you prefer Google’s alternate domain recommendation.

parametertypedescription`$captcha_api`stringThe CAPTCHA API URL that WPForms will enqueue. Return a different URL to override it.## Source

`wpforms\src\Frontend\Captcha.php`

## Example

```

/**
 * Load reCAPTCHA from the alternate domain.
 */
function wpf_dev_change_recaptcha_url( $captcha_api ) {
    return str_replace(
        'https://www.google.com/recaptcha/api.js',
        'https://www.recaptcha.net/recaptcha/api.js',
        $captcha_api
    );
}
add_filter( 'wpforms_frontend_captcha_api', 'wpf_dev_change_recaptcha_url' );
```

## Reference Article

- [How to Change the URL For the reCAPTCHA Script](https://wpforms.com/developers/how-to-change-the-url-for-the-recaptcha-script/)

**Categories:** Filters Hooks

---

</body></html>