# About the login form

**URL:** <https://community.gravityforms.com/t/about-the-login-form/13298>\
**Category:** Get Help\
**Tags:** custom, login-form\
**Created:** [August 24, 2022, 1:33am UTC](https://community.gravityforms.com/t/about-the-login-form/13298 "2022-08-24T01:33:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5f4a1980c9b9a230](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@user5f4a1980c9b9a230](https://community.gravityforms.com/u/user5f4a1980c9b9a230)\
**Post date:** [August 24, 2022, 1:33am UTC](https://community.gravityforms.com/t/about-the-login-form/13298/1 "2022-08-24T01:33:23Z")

</div>

I have a question about the login form of the user registration add-on.  
Can I change/correct the error message?

---

<div class="post-metadata">

**Author:** ![sacom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/sacom/32/53_2.png) [@sacom](https://community.gravityforms.com/u/sacom)\
**Post date:** [August 24, 2022, 11:48am UTC](https://community.gravityforms.com/t/about-the-login-form/13298/2 "2022-08-24T11:48:13Z")

</div>

Do you mean the errors displayed when the wrong username or password are entered? If so, those errors are returned by WordPress, not by the add-on, so you would need to approach the change from WordPress side of things.

---

<div class="post-metadata">

**Author:** ![user5f4a1980c9b9a230](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@user5f4a1980c9b9a230](https://community.gravityforms.com/u/user5f4a1980c9b9a230)\
**Post date:** [August 27, 2022, 6:06am UTC](https://community.gravityforms.com/t/about-the-login-form/13298/3 "2022-08-27T06:06:38Z")

</div>

Thank you for contacting us.  
Added the following to functions.php:  
It works for WordPress login forms.  
It doesn’t work for Gravity Forms login forms.  
what am i doing wrong?

→ functions.php

```auto
function custom_login_errors( $errors, $redirect_to ) {
    if( isset( $errors->errors['invalid_email'] ) ){
        $errors->remove( 'invalid_email' );
        $errors->add( 'invalid_email', 'This is an error.' );
   }
    if( isset( $errors->errors['invalid_username'] ) ){
        $errors->remove( 'invalid_username' );
        $errors->add( 'invalid_username', 'This is an error.' );
    }
    if( isset( $errors->errors['incorrect_password'] ) ){
        $errors->remove( 'incorrect_password' );
        $errors->add( 'incorrect_password', 'This is an error.' );
    }
    if( isset( $errors->errors['empty_username'] ) ){
        $errors->remove( 'empty_username' );
        $errors->add( 'empty_username', 'This is an error.' );
    }
    if( isset( $errors->errors['empty_password'] ) ){
        $errors->remove( 'empty_password' );
        $errors->add( 'empty_password', 'This is an error.' );
    }
    if( isset( $errors->errors['confirm'] ) ){
        $errors->remove( 'confirm' );
        $errors->add( 'confirm', 'This is an error.', 'message' );
    }
    return $errors;
}
add_filter( 'wp_login_errors', 'custom_login_errors', 10, 2 );

```

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [September 6, 2022, 8:11pm UTC](https://community.gravityforms.com/t/about-the-login-form/13298/4 "2022-09-06T20:11:44Z")

</div>


