How to Rename State Label at Checkout in WooCommerce?

You might need to change the checkout “state” field on both billing and shipping pages. In this article, you will learn to rename State label at Checkout in WooCommerce.

All you need to do is change the field ID. Doing so, the snippet will get executed on the given checkout field. One can even use this code to rename other checkout field areas. Such field areas include country, first_name, last_name, city, postcode, company, address, etc. You just need to modify ‘state’ within square brackets in the below-given code. 

Image showing how to rename State label at Checkout page in WooCommerce

PHP Snippet: Rename State label at Checkout in WooCommerce

add_filter( 'woocommerce_default_address_fields' , 'phpsof_rename_state_province', 9999 );
function phpsof_rename_state_province( $fields ) {
    $fields['state']['label'] = 'Province';
    return $fields;

Where do you add this snippet?

So, this is how you rename State label at Checkout in WooCommerce.  You can use this same snippet to change other default fields at checkout page. Also, it is easier to activate this function with this code.

So, to apply this code, just add this PHP snippet at your child theme function.php file’s bottom. It should be placed before “?>”, if you have it there. Apart from this, CSS goes in your child theme style.css file. We do not recommend to add this snippet in your main theme. Make sure that you are editing these files in a right manner for best results.

This way, you show rename State label at Checkout. For instance, you can change state label to country or province.

Is this snippet still valid?

I have applied this code on the Storefront theme and WordPress friendly hosting PHP 7.3. Let me know if everything works as expected when you code. Share it further if you find this snippet useful for you and it had saved your time. 

Also Read, How to Show Checkout Even If Cart is Empty in WooCommerce?

How to Move Order Notes at Checkout Page in WooCommerce?

Important links: WooCommerce –