How to Remove Checkout Fields from WooCommerce?
One of the most crucial processes in any eCommerce store is checkout. Keep things simple if you want to be successful and increase your sales. As a result, we’re going to show you How to Remove Checkout Fields from WooCommerce?
You Might Also Like Free Elementor Templates For WordPress Website
If you want to learn More About Elementor Page Builder
Why disable WooCommerce checkout fields?
The Users add items to their shopping carts but they leave the site without purchasing anything, just because of the lengthy and confusing checkout process.
To avoid this, the checkout page should be simple and contain only the fields that are required. This is especially true if you sell digital or virtual things like software, music, or ebooks. Because this type of goods does not require shipping, it should have its own checkout page that does not require information such as an address or a postal code.
Remove Checkout Fields from WooCommerce
So, to boost conversion let’s start step by step guide on how to remove checkout fields from WooCommerce.
Step 1: Copy the below snippet.
/* 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_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;
}
Step 2: Go to Child Theme > Function.php > Paste Code
If you look at the code, you’ll note that identifying which checkout field each line represents is simple.
You can simply delete the line of code that represents the individual field if you want to display any checkout fields that have been removed.
For example, you want to display a bill’s first name then you need to delete the below fields line from the code.
unset($fields['billing']['billing_first_name']);
It’s Done. We hope you find How to Remove Checkout Fields from WooCommerce post helpful but if you still face issues then comment below.