Prevent users from changing the password

 forgotten password "title =" forgotten password "width =" 500 "height =" 554 "class =" aligncenter size-full wp-image -10440 "srcset ="ña-olvidada.jpg 500w, -lessed-451x500.jpg 451w "sizes =" (max-width: 500px) 100vw, 500px "/> </p>
<p> You see, put yourself in situation: you have created a site, you ensure the maximum security of your WordPress, you limit the access attempts, apply security policies, avoid giving hints to hackers, even <strong> shield your installation </strong>. </p>
<p> Well, you have to <strong> give access to different users </strong> to your site, <strong> create strong passwords </strong> and, <strong> in your first access change it for something like your dog's name </strong>or your birthday or the typical "God", "password" and things A) Yes.[19659003] Well, if you do not want <strong> the weakest part in computer security </strong> (the user) to do his thing you can <strong> remove the form for the password change </strong>and so you heal in health. </p>
<p> Just add the following code to the file <code> functions.php </code> and <strong> all non-Administrator users will not see and, consequently, will not be able to change their Access password </strong>: </p>
<div id=

// disable key change

if ( is_admin () )

[19659016] add_action ( 'init' 'disable_password_fields' 10 ) ;

function [19659011] disable_password_fields () {

if ( ! current_user_can ( 'administrator' ) )

$ show_password_fields = add_filter ( 'show_password_fields' '__ return_false' ) ;


If someone wants to change the password, they will have to request it from you, or another administrator, with which you will have control.

little wonder of code I found it in W P Engineer

NOTICE : This publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you: