# Load the WooCommerce Password Strength Meter Only When Needed

> Removes the password strength meter script (about 400 KB with its dictionary) from every page except the account, checkout and password reset pages where customers actually choose a password.

- Type: PHP
- Runs: Frontend only
- Category: [Performance](https://wpide.com/library/category/performance/)
- Requires: WooCommerce
- Tags: woocommerce, javascript, page-weight
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/perf-woo-password-meter-account-only/

## Code

```php
add_action( 'wp_print_scripts', function () {
    if ( ! function_exists( 'is_account_page' ) ) {
        return;
    }

    if ( is_account_page() || is_checkout() || ( isset( $_GET['action'] ) && 'rp' === $_GET['action'] ) ) {
        return;
    }

    wp_dequeue_script( 'wc-password-strength-meter' );
    wp_dequeue_script( 'password-strength-meter' );
    wp_dequeue_script( 'zxcvbn-async' );
}, 100 );
```

## Notes

The meter still appears on the pages where it is useful.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Load the WooCommerce Password Strength Meter Only When Needed" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
