Disable login suggestions when logging errors - Technology tips

    Do you want to turn off error messages or login suggestions when someone logs in to your WordPress?

    By default, WordPress displays an error message when someone enters an incorrect username or password on the login page. These error messages can be used as a suggestion to guess a username, user email address or password. In this article, we will show you how to turn off login hints in WordPress login error message.

    disable wordpress error login error message

    Login hints in WordPress What is login error message

    During login, WordPress displays this error message when the user enters an incorrect username

    Error Invalid username. Forgot password?

    If someone enters the correct username with the wrong password, then WordPress will display this message:

    Error: The password you have entered for the johnsmith username is incorrect. Forgot password?

    If someone is trying to guess your username, this error message confirms that they have successfully guessed.

    As of WordPress 4.5, you can also log into your WordPress website with an email address instead of a username. These login suggestions can also confirm that you are using a specific email address for your administrator account.

    For most WordPress users, this is probably not a big deal. But for those cautious about privacy and security, this can be a problem.

    For added security, you must always use a strong username and password for your administrator account. Refer to the article on security for wordpress

    Hide login login in WordPress

    Simply add the following code snippet to your theme's functions.php or a site specific plugin

    function no_wordpress_errors(){
      return 'Something is wrong!';
    add_filter( 'login_errors', 'no_wordpress_errors' );

    This code adds your custom message as a filter for login errors. This will override WordPress default login errors.

    Now if someone enters an incorrect username, password or email, WordPress will only display the ‘Something is wrong’ error without giving any suggestions.

    Although this code may hide login errors, it cannot save you from more sophisticated hacking attempts or bruce force attacks.

    We hope this article helped you hide login suggestions from WordPress login error messages. You may also want to see these on 14 ways to protect wordpress admin area.

    If you liked the article "Turn off login login when logging in error" please comment below and share it for everyone to read. Thank you for following the article. And if you want to copy the article, please cite the source: https://tipstechvn.com/tat-goi-y-dang-nhap-khi-dang-nhap-loi/

    Không có nhận xét nào