How do I remove the eye icon that shows visibility on login screen and reset password screen

I'm looking for a way to remove the eye icon that shows visibility on login screen (wp-admin and wp-login) and reset password screen (/wp-login.php?action=rp).

As you can see on the screenshot below :

Login Page :

Reset password Page :

Update : I need to remove this button not only the visibility :

Thanks in advance for your reply.

regards.

Topic password icon login customization Wordpress

Category Web


You can use the same mechanism to enqueue some JavaScript that will actually remove the button:

function remove_wp_hide_pw_button() {
?><script>
if ((document.addEventListener != null) && (document.querySelector != null)) {
    document.addEventListener( 'DOMContentLoaded', function() {
        var b = document.querySelector('button.wp-hide-pw');
        if (b != null) b.remove();
    });
}
</script>
<?php
}
add_action('login_footer', 'remove_wp_hide_pw_button');

However the button will appear briefly then disappear, so you probably do need CSS to hide it the button or icon too.


This is one way

add_action('login_head', 'my_remove_eye');

function my_remove_eye() {
  echo 
    '<style>
        span.dashicons-visibility:before {
        content: "";
    }
    </style>';
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.