WordPress password reset manipulate.
Marc Wagner
September 25, 2020
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.
Artikel von:
Marc Wagner
Hi Marc here. I’m the founder of Forge12 Interactive and have been passionate about building websites, online stores, applications and SaaS solutions for businesses for over 20 years. Before founding the company, I already worked in publicly listed companies and acquired all kinds of knowledge. Now I want to pass this knowledge on to my customers.