55
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!
PHP Snippet: Rename State Label @ Checkout Page
/**
* @snippet Rename State Field Label @ WooCommerce Checkout
* @how-to Get tutoraspire.com FREE
* @author Tutor Aspire
* @compatible WooCommerce 3.6.4
* @donate $9 https://tutoraspire.com
*/
add_filter( 'woocommerce_default_address_fields' , 'tutoraspire_rename_state_province', 9999 );
function tutoraspire_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‘