Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we disable wp_generate_password function in wordpress?

Tags:

wordpress

Is there a way to disable random password generation in Word press ?

how can we disable wp_generate_password function

like image 472
Bharath Kumar Avatar asked Mar 31 '16 09:03

Bharath Kumar


People also ask

Should I disable application passwords on my WordPress website?

Moreover, if your WordPress website doesn't have an SSL certificate, attackers on your network or the networks between your website and the application sites can see the passwords. Thus, if you don't really need APIs, it's highly recommended to disable the Application Passwords feature when you upgrade your site to WordPress 5.6.

How to reset a WordPress User’s password?

You can see the plugin in action by visiting the WordPress login page and clicking on ‘Lost your password?’ link. It will take you to the password reset page where you can try entering the username or email address for a user who does not have password reset option.

How to protect passwords with a WordPress plugin?

For more details, see our step by step guide on how to install a WordPress plugin. Upon activation, you need to visit Settings » Protect Passwords page to configure the plugin settings. Simply select the user roles or individual users to disable their password change or reset option.

How to disable password strength meter in WordPress?

You just need to install and activate WC Password Strength Settings By Daniel Santoro it’s a Free version. But if you are looking premium version then you should try perfmatters. just activate and select ” Disable Password Strength Meter “. 2. Without Plugin Method.


1 Answers

For inexperienced users can be annoying/confusing to see auto-generated password on first screen. Add the following code to the wp-content/themes/your_current_theme/functions.php to disable this function.

add_filter( 'random_password', 'disable_random_password', 10, 2 );

function disable_random_password( $password ) {
    $action = isset( $_GET['action'] ) ? $_GET['action'] : '';
    if ( 'wp-login.php' === $GLOBALS['pagenow'] && ( 'rp' == $action  || 'resetpass' == $action ) ) {
        return '';
    }
    return $password;
}
like image 117
eapo Avatar answered Oct 29 '22 03:10

eapo