Change Default country and state on WooCommerce checkout

[cc lang=”php”]

add_filter( ‘default_checkout_country’, ‘wpsnip_default_checkout_country’ );
add_filter( ‘default_checkout_state’, ‘wpsnip_default_checkout_state’ );

function wpsnip_default_checkout_country() {
return ‘US’;
}
function wpsnip_default_checkout_state() {
return ‘CA’;
}
[/cc]

Newsletter

I’ll be creating more content about starting and running WordPress plugin businesses. You can follow the journey by joining my mail list.

Leave a Comment