You can replace or remove the automatic password generated by WordPress at any time by adding the following small code to the “functions.php” of your child theme.
function removeRandomPassword( $password ) {
$action = isset( $_GET['action'] ) ? $_GET['action'] : '';
if ( 'wp-login.php' === $GLOBALS['pagenow'] && ( 'rp' == $action || 'resetpass' == $action ) ) {
return __('Password...', 'twentysixteen');
}
return $password;
}
add_filter( 'random_password', 'removeRandomPassword', 15 );
Note: __(‘Password…’,’twentysixteen’) you can of course adapt to your wishes. It is only important that you enter the text domain of your child theme for ‘twentysixteen’, so that you can still use the translations in the backend of your WordPress site.
Was this article helpful? Then leave us a short comment. We are happy about your feedback.
Comments