If you are regular reader of my site you will have noticed that I recently added a Shop page to my site to start selling some digital products.
If you see the default checkout form that Woocomerce comes with, it has way too many fields which hurts conversion rates.
Today I’ll show you how to remove any unwanted fields.
You won’t need to spend a ridiculous $49 to edit your fields.
Here’s how you can do that for free.
2 ways to edit your checkout
- Using the Customizer on WordPress
- Using a few lines of code if you need further customization
Easily tweak your Woocomerce checkout form with Customize
- Go to Appearance > Customize
- Then go to Woocomerce > Checkout
- Then select the fields to Hidden / Optional / Required
If you need better granularity, you can use the following steps.
✋ Stop worrying about SEO and have me do it for you
PS: Ready to work with the 0.01% of all SEOs worldwide? Click here.
Steps to edit Woocomerce checkout fields
- Download and activate the My Custom Functions plugin (or alternatively edit the functions.php file on your Child Theme)
- Once in the plugin (which you can find on Settings > PHP inserter) or in your functions.php, paste the code below and save changes.
- Done!
/* WooCommerce: Remove Checkout Fields */ add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { unset($fields['billing']['billing_first_name']); unset($fields['billing']['billing_last_name']); unset($fields['billing']['billing_company']); unset($fields['billing']['billing_address_1']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_country']); unset($fields['billing']['billing_state']); unset($fields['billing']['billing_phone']); unset($fields['order']['order_comments']); unset($fields['billing']['billing_email']); unset($fields['account']['account_username']); unset($fields['account']['account_password']); unset($fields['account']['account_password-2']); return $fields; }
Note that the above code removes all fields, if you want to keep a few (for instance: First Name, Last Name, Email) simply delete the corresponding lines like I did here:
That code is this one
/* WooCommerce: The Code Below Removes Checkout Fields */ add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { unset($fields['billing']['billing_company']); unset($fields['billing']['billing_address_1']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_country']); unset($fields['billing']['billing_state']); unset($fields['billing']['billing_phone']); unset($fields['account']['account_username']); unset($fields['account']['account_password']); unset($fields['account']['account_password-2']); return $fields; }
Now your checkout should look a lot cleaner!
Conclusion
Hope you enjoyed this quick trip to customize your Woo-commerce checkout fields.
Which other scripts you want me to share? Let me know in the comments!
Are you a marketer? Here are other scripts you will enjoy: