disable zxcvbn.min.js in wordpress and woocommerce

前端 未结 4 1570
别跟我提以往
别跟我提以往 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

    Add the following to your theme's function.php or to a custom plugin:

    //disable zxcvbn.min.js in wordpress
    add_action('wp_print_scripts', 'remove_password_strength_meter');
    function remove_password_strength_meter() {
        // Deregister script about password strenght meter
        wp_dequeue_script('zxcvbn-async');
        wp_deregister_script('zxcvbn-async');
    }
    

提交回复
热议问题