Last updated on September 13, 2023

Disable Password Strength Meter

Don’t know where to add this snippet? Read our guide: How to add code snippets.

Disable the password strength meter.

To disable the WordPress password strength meter, you can use the wp_enqueue_scripts hook to dequeue the script responsible for password strength validation. Here’s an example of how you can disable the password strength meter:

function wpsnippets_disable_password_strength_meter() {
    if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
        wp_dequeue_script( 'wc-password-strength-meter' );
    }
}

add_action( 'wp_enqueue_scripts', 'wpsnippets_disable_password_strength_meter', 9999 );

This code checks if the wc-password-strength-meter script is enqueued and dequeues it if it is. The high priority of 9999 ensures that it runs late in the enqueueing process to ensure the script is dequeued properly.

By adding this code snippet, you will disable the password strength meter functionality in WordPress, and users will no longer see the password strength indicator when setting or resetting their passwords.

Last updated on September 13, 2023. Originally posted on May 17, 2023.

Leave a Reply