### [wpforms_user_registration_process_registration_process_username_exists_error_message](https://wpforms.com/developers/wpforms_user_registration_process_registration_process_username_exists_error_message/)

**Published:** March 31, 2020
**Author:** Editorial Team

**Excerpt:** The wpforms_user_registration_process_registration_process_username_exists_error_message filter is used to show a message when using the User Registation addon and the username already exists.

**Content:**

## Description

The `wpforms_user_registration_process_registration_process_username_exists_error_message` filter used to provide a message on User Registration addon if the username already exists.

## Parameters

$msg*(string)* Message that displays if username already exists.## Source

`wpforms-user-registration/src/Process/Registration.php`

## More Information

The filter is used to display a message if the username already exists.

## Example

```

/**
 * Username already exists.
 *
 * @link    https://wpforms.com/developers/wpforms_user_registration_process_registration_process_username_exists_error_message/
 *
 * @param   string   $msg  Message that displays if username already exists.
 * @return  string
 */

function wpf_dev_user_registration_username_exists( $msg ) {
 
    // This is the message that would appear
    $msg =  __('A user with that username already exists. Please log in here to your account.', 'text-domain');
 
    return $msg;
}
 
add_filter( 'wpforms_user_registration_process_registration_process_username_exists_error_message', 'wpf_dev_user_registration_username_exists', 10, 1 );

```

## Reference Articles

[How to Change Validation Messages for User Registration addon](https://wpforms.com/developers/change-validation-messages-for-user-registration-addon/ "How to Change Validation Messages for User Registration Addon")

**Categories:** Filters Hooks

**Tags:** PHP, User Registration Addon

---

