How to Change WooCommerce Checkout Labels

WooCommerce Change Checkout LabelsThe checkout process is very important in any WooCommerce store, as it is the last chance you have to convince shoppers to make a purchase. Several factors influence abandoned carts like shipping costs, but the checkout page itself also plays a role.

WooCommerce Change Checkout Labels

If the checkout process is too long, complicated, or requires information that is too personal, customers might opt to buy the product elsewhere. This will affect your sales in the long run.

WooCommerce Change Checkout Field Labels

One way you can optimize the checkout page is to change the name of the checkout fields. This article will walk you through how you can change the checkout field labels using a custom PHP code snippet that I will share.

Steps to Change the State Checkout Field Label

I will change the rename the WooCommerce checkout “state” field label for both billing & shipping for illustration purposes. Here are the steps that you need to follow:

  1. Log into your WordPress site and access the dashboard as the admin user
  2. From the dashboard menu, click on the Appearance Menu > Theme Editor Menu. When the theme editor page is opened, look for the theme functions file with the extension functions.php. Open this functions file to add the function to change the state checkout field label.
  3. Add the following code in the functions.php file:
/**

 * @snippet       Rename State Field Label @ WooCommerce Checkout

*/

 add_filter( 'woocommerce_default_address_fields' , 'njengah_rename_state_province', 9999 );

function njengah_rename_state_province( $fields ) {

    $fields['state']['label'] = 'Province';

    return $fields;

}
  1. This code snippet will change the ‘state’ label to ‘province’, as shown below:

However, if you want to rename other fields, replace ‘state’ inside the square brackets with:

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

Conclusion

This post shares how you can change the name of any field on the checkout page. All you need to do is change the name in the square brackets to the one you want to change. You should also note that this is a developer-level tutorial. If you encounter any problems, please consider hiring a qualified WordPress developer so that you do not break down your site.

Similar Articles