Skip to content

Instantly share code, notes, and snippets.

@jrick1229
Created April 15, 2021 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrick1229/7c6e6864bbff55690e52c7e4b320c6ee to your computer and use it in GitHub Desktop.
Save jrick1229/7c6e6864bbff55690e52c7e4b320c6ee to your computer and use it in GitHub Desktop.
Remove the state field from both shipping and billing details section
<?php
add_filter( 'woocommerce_billing_fields', 'wc_remove_shipping_billing_state' );
add_filter( 'woocommerce_shipping_fields', 'wc_remove_shipping_billing_state' );
function wc_remove_shipping_billing_state( $fields ) {
unset( $fields[ 'billing_state' ] );
unset( $fields[ 'shipping_state' ] );
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment