How to remove password strength checker from WordPress / WooCommerce
WooCommerce and WordPress have an integrated Password Strength Meter which forces users to use strong passwords. It loads the following files:
/wp-includes/js/zxcvbn.min.js
/wp-admin/js/password-strength-meter.min.js
If you’re running WooCommerce, the above file may be located here:
/wp-content/plugins/woocommerce/assets/js/frontend/password-strength-meter.min.js
Forcing users to think of a strong password on crucial pages like the cart or the checkout in order to login or register, may result in more abandoned carts and less orders to your store.
Note that it is not recommended to remove the password strength check for security reasons.
Luckily, the password strength parameters are editable and we can disable it by dequeue-ing the script for password strength.
PHP snippet: disable password strength meter in WooCommerce / WordPress
function webroom_wc_remove_password_strength() { if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) { wp_dequeue_script( 'wc-password-strength-meter' ); } } add_action( 'wp_print_scripts', 'webroom_wc_remove_password_strength', 100 );
Add the code to your child theme’s functions.php file.
PHP Snippet: Change WooCommerce default password security level
If you don’t want to completely remove the password strength meter in WooCommerce / WordPress, there is an option to change the strenght level. The hook setting for that is woocommerce_min_password_strength filter hook. So you can set a custom hook function and lowering this strenght. There is 4 possible settings:
/** * Change the strength level on the woocommerce password * * Strength Settings * 4 = Strong * 3 = Medium (default) * 2 = Also Weak but a little stronger * 1 = Password should be at least Weak * 0 = Very Weak / Anything */ add_filter( 'woocommerce_min_password_strength', 'webroom_change_password_strength' ); function webroom_change_password_strength( $strength ) { return 2; }
Related Articles
If you enjoyed reading this, then please explore our other articles below:
More Articles
If you enjoyed reading this, then please explore our other articles below: