WooCommerce Custom Checkout Fields: Edit,Delete Fields and Email


WooCommerce is, without any doubt, a very powerful ecommerce plugin for WordPress. It is capable enough to setup and manage successful ecommerce store of sizable proportions.

In my previous article, I covered How to add additional custom fields into WooCommerce checkout page. In this tutorial, I will continue the topic and explain how you could dynamically customize additional fields such as removing the billing address, add/edit custom checkout fields and save these custom fields to the database. I will also discuss how you could add these custom fields to order emails.

Remove Billing Address of WooCommerce Custom Checkout Fields

The following code removes the address fields from the billing screen.

function cloudways_billing_filter($fields){ unset( $fields[“billing_first_name”] ); unset( $fields[“billing_last_name”] ); return $fields; } add_filter( ‘woocommerce_billing_fields’, ‘cloudways_billing_filter’ );

1

2

3

4

5

6

function cloudways_billing_filter($fields){

unset( $fields[“billing_first_name”] );

unset( $fields[“billing_last_name”] );

return $fields;

}

add_filter( ‘woocommerce_billing_fields’, ‘cloudways_billing_filter’ );

Add this code snippet to the functions.php, located in the