Remove specific states of a country on Woocommerce Checkout

Share Now

Share on facebook
Share on pinterest
Share on twitter
Share on linkedin
Share on email

*** Add this code on functions.php

 * Modify Woocommerce states array
 * @param array $states, collection of all $states
 * @return array $states, modified array.
add_filter( 'woocommerce_states', function( $states ){
    // Unset Hawaii
    unset( $states['US']['HI'] );

    return $states;
}, 999);
Nahid Mahamud

Nahid Mahamud

Web Developer | Graphic Designer | WordPress & Woo-commerce Expert