• Resolved katmacau

    (@katmacau)


    I need to customise the login form error message that appears when a user enters an incorrect password into the front end login form.

    I tested using add_filter(‘login_errors’,’login_error_message’) fitltering which works to customise the error message on the standard wp-login form. However it has no impact on the forminator login. I could see this in the form settings. Is there a hook, filter etc that I can use to customise this.

    I need something more generic and without the forgot password link in it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @katmacau,

    Please check and see whether the following helps:

    <?php
    
    function forminator_change_error_message( $translated_text, $untranslated_text, $domain ) {
       if ( $untranslated_text == '<strong>Error:</strong> The password you entered for the username %s is incorrect.' ) {
           $translated_text = 'Your custom error message goes here';
       }
       return $translated_text;
    }
    add_filter( 'gettext', 'forminator_change_error_message', 20, 3 );
    

    You need to edit the following line in the above code to your own custom message::

      $translated_text = 'Your custom error message goes here';

    The code can be added as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Best Regards,

    Nithin

    Thread Starter katmacau

    (@katmacau)

    Thanks. That updates the message but it does not remove the Lost your password that is added to the end of that error message.

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @katmacau,

    The text and URL of this link are coded separately from the error message, and the easiest way to hide the link would be using custom CSS.

    Please try adding the following CSS rules:

    .forminator-error a[href="https://example.com/wp-login.php?action=lostpassword"] {
      display: none;
    }

    – replace “example.com” with your domain name here.

    You can add them on the Appearance tab:
    https://prnt.sc/_YcjdHqNnWzY

    Best Regards,
    Dmytro

    Thread Starter katmacau

    (@katmacau)

    Thanks. Removed the link with CSS now. That covers it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Customise the incorrect password message on login forms’ is closed to new replies.