disable zxcvbn.min.js in wordpress and woocommerce

前端 未结 4 1582
别跟我提以往
别跟我提以往 2021-02-10 13:41

As you know zxcvbn.min.js is around 400kb and loaded by default in wordpress websites , I want to know how I can prevent this JavaScript library to load As I don\'t want passwo

4条回答
  •  面向向阳花
    2021-02-10 14:24

    This code in my theme function.php worked for me:

    /**
     * Deregister scripts
     */
    function deregister_or_dequeue_scripts() {
        wp_dequeue_script('wc-password-strength-meter');
    }
    
    add_action('wp_print_scripts', 'deregister_or_dequeue_scripts', 20);
    

    It will remove wc-password-strength-meter javascript and all its dependences (including zxcvbn.min.js).

提交回复
热议问题