Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Remove Default Value of Country & State Field in WooCommerce Checkout?

When a customer reaches the checkout page, the billing section is automatically populated with the default country field. However, if you want to disable this feature and require customers to select their country & state fields from a dropdown instead, here is the solution.

add_filter( 'default_checkout_billing_country', 'ts_change_default_checkout_country' );
add_filter( 'default_checkout_billing_state', 'ts_change_default_checkout_state' );

function ts_change_default_checkout_country() {
    return null;
}

function ts_change_default_checkout_state() {
    return null;
}

Output

The following output shows that the WooCommerce checkout page does not populate the country & state field by default.

How to Remove Default Value of Country & State Field in WooCommerce Checkout

Similarly, you can also restrict billing to a particular country on the WooCommerce checkout page.

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x