WordPress uses this library to provide feedback on password strength in registration and password reset forms. This approach was inspired by the password security methodology originally created by Dropbox. It’s a convenient method to assist users in enhancing password strength without imposing strict rules such as “use 8-10 characters, one number, one uppercase letter,” and so on. When users create a password for their WordPress account, they see a meter indicating the strength of their password by default.
This password strength meter feature is handled automatically by a few files, one of them being: zxcvbn.min.js
and may be loaded from these paths:
/wp-includes/js/zxcvbn-async.min.js /wp-includes/js/zxcvbn.min.js /wp-admin/js/password-strength-meter.min.js /plugins/woocommerce/assets/js/frontend/password-strength-meter.min.js
By default zxcvbn.min.js
, and the other related files shouldn’t be loaded on every page but only on pages where it is actually needed but plugins and themes can decided to use this feature and may end up loading it across all pages of your site. In those cases you might see it show up on a PageSpeed test as causing a speed issue, here I present a Tree-Map from Google Page Speed service:
Disable the password strength meter and prevent zxcvbn.min.js loading everywhere
function remove_password_strength_meter() { wp_dequeue_script('password-strength-meter'); } add_action('wp_print_scripts', 'remove_password_strength_meter'); function remove_zxcvbn_script() { wp_dequeue_script('zxcvbn'); } add_action('wp_print_scripts', 'remove_zxcvbn_script');
But I used them with condition wrapper for specific pages only
function ww2_disable_password_strength_meter() { // Skip in the admin area if ( is_admin() ) { return; } // Skip on wp-login.php if ( ( isset( $GLOBALS['pagenow'] ) && $GLOBALS['pagenow'] === 'wp-login.php' ) || ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'rp', 'lostpassword', 'register' ) ) ) ) { return; } // Skip specific WooCommerce endpoints if ( class_exists( 'WooCommerce' ) && ( is_account_page() || is_checkout() ) ) { return; } // Dequeue and deregister password strength scripts wp_dequeue_script( 'zxcvbn-async' ); wp_deregister_script( 'zxcvbn-async' ); wp_dequeue_script( 'password-strength-meter' ); wp_deregister_script( 'password-strength-meter' ); wp_dequeue_script( 'wc-password-strength-meter' ); wp_deregister_script( 'wc-password-strength-meter' ); }