Coding Notes WordPress

How To Disable selectWoo If It’s Not Working In WooCommerce

I have this issue with selectWoo and WooCommerce where if you change the country the states select field doesn’t hide. I didn’t have time to debug it or find a solution so I just removed it completely by de-registering the selectWoo scripts and styles.

The quick fix (place this in your themes functions.php):

add_action( 'wp_enqueue_scripts', function () {
  if ( class_exists( 'woocommerce' ) ) {
      wp_dequeue_style( 'selectWoo' );
      wp_deregister_style( 'selectWoo' );
      wp_dequeue_script( 'selectWoo' );
      wp_deregister_script( 'selectWoo' );
} );


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.