WooCommerce: Rename “State” Label @ Checkout

 Here’s a super quick snippet you can use to rename the WooCommerce checkout “state” field label for both billing & shipping.

Of course you can learn by example and apply the same snippet to other checkout fields, all yopu need to change is the field ID. Enjoy!

How to rename the “State” checkout field

PHP Snippet: Rename State Label @ Checkout Page

/**
 * @snippet       Rename State Field Label @ WooCommerce Checkout
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.6.4
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */
 
add_filter( 'woocommerce_default_address_fields' , 'bbloomer_rename_state_province', 9999 );
 
function bbloomer_rename_state_province( $fields ) {
    $fields['state']['label'] = 'Province';
    return $fields;
}

If you want to rename other fields, just replace ‘state‘ inside the square brackets with:

  • country
  • first_name
  • ‘last_name
  • ‘company
  • address_1
  • address_2
  • city
  • postcode

No comments:

Post a Comment

Free Shipping Threshold @ Cart Page