How to Set Up WooCommerce Checkout Field Placeholder

WooCommerce Checkout Field PlaceholderThe WooCommerce checkout page needs to be customized, as it is the most important step in the customer’s journey. It is the last chance to convince shoppers to make a purchase. There are a variety of factors that impact abandoned carts, like the shipping costs and payment options. However, the checkout page plays a role. If customers are confused when filling the fields, they will not be able to complete the checkout process.

WooCommerce Checkout Field Placeholder

One way to solve this problem is to add placeholder texts or labels in the fields. Users will not have a hard time filling in the fields, making it easier for customers to complete the checkout.

You can make several tweaks on the WooCommerce Checkout page. WooCommerce provides nearly endless flexibility for every experience level. If you are comfortable editing code, you can customize with code snippets, as you will see in this tutorial.

Steps to Change the Input Labels and Placeholders

Here are the steps 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 input labels and placeholders. You can customize it to fit your needs.
  3. Add the following code in the functions.php file:
add_filter('woocommerce_checkout_fields', 'njengah_override_checkout_fields');

function njengah_override_checkout_fields($fields)

 {

 unset($fields['billing']['billing_address_2']);

 $fields['billing']['billing_company']['placeholder'] = 'Business Name';

 $fields['billing']['billing_company']['label'] = 'Business Name';

 $fields['billing']['billing_first_name']['placeholder'] = 'First Name';

 $fields['shipping']['shipping_first_name']['placeholder'] = 'First Name';

 $fields['shipping']['shipping_last_name']['placeholder'] = 'Last Name';

 $fields['shipping']['shipping_company']['placeholder'] = 'Company Name';

 $fields['billing']['billing_last_name']['placeholder'] = 'Last Name';

 $fields['billing']['billing_email']['placeholder'] = 'Email Address ';

 $fields['billing']['billing_phone']['placeholder'] = 'Phone ';

 return $fields;

 }
  1. This is the outcome:placeholder checkout

Conclusion

In this post, you have seen how it is easy to change the labels and placeholders on input field labels on the checkout page. If you prefer a little more structure, there are a variety of extensions and plugins for editing checkout fields.

Similar Articles