I need to remove the auto complete password within the login page. I understand I need to set autocomplete="off". There is another article on this site (How to disable autocomplete on the wp-login.php page) which gives some solutions, but not being all that experienced not sure where to apply the code.
I dont want anything fancy and do not mind editing wp-login.php directly, but where do I put autocomplete="off" and whats the complete syntax please?
EDIT
clearing internet history, when logging in I enter username and password and click, remember me. I log out and back in, it remembers my username and not my password.
IE and Chrome do both ask if I want to remember, and if clicking yes, it remembers username and password.
Adding the code doesn't seem to make a difference to this. Web browser still prompts do you want to remember and works.
function wpse_159462_login_form() {
echo <<<html <script>
document.getElementById( "user_pass" ).autocomplete = "off"; </script>
html;
}
add_action( 'login_form', 'wpse_159462_login_form' );
I then changed the ID from "user_pass" to "user_login" and the Username is now no remembered, this is workable as the wordpress login isn't remembering anything now.
However looking at the original requirement, here's the background;
The issues is that the site in question had a security audit and raised the following, response has been trimmed
"Password ‘autocomplete’ is enabled on the authentication page for wordpress. The following URL has a form which allow for credentials to be cached by the browser: https://siteremoved/wp-login.php. To prevent the users web browser from prompting users to cache the credentials, the autocomplete=off.
Web browser still asking to remember the logon details. Are there any other options? I know this will be a pain for the users, but I have been informed this is a mandatory requirement for this site.