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

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

**Content:**

## Description

The `wpforms_form_locker_age_get_error_message` filter lets you customize the age verification error message displayed by the Form Locker addon when a user does not meet the minimum age requirement. By default, WPForms shows a standard message, but you can override it with your own wording.

This filter is especially useful when you want to add context-specific language to your forms. For example, you can use it to explain why a user is restricted or suggest alternative actions if they fail age verification.

parametertypedescription`$message`stringThe default error message shown when the age verification fails.`$form_id`intThe ID of the current form.`$form_data`arrayThe form settings and configuration data.## Source

`wpforms-form-locker\src\Lockers\Age.php`

## Example

```

function wpf_dev_custom_age_error( $message, $form_id, $form_data ) {
    if ( $form_id === 123 ) {
        $message = __( 'Sorry, you must be 18 or older to complete this form.', 'text-domain' );
    }
    return $message;
}
add_filter( 'wpforms_form_locker_age_get_error_message', 'wpf_dev_custom_age_error', 10, 3 );

```

## Reference Article

- [Customizing the Form Locker Age Verification Message](https://wpforms.com/developers/customizing-the-form-locker-age-verification-message/)

**Categories:** Filters Hooks

---

</body></html>