Need help? Book our fixed price WordPress Support service.

Compulsory WooCommerce Billing Fields

To make WooCommerce Billing fields compulsory, the following code can be added to functions.php. Please note unless you are experienced with php, you shoul dproceed with caution as an incorrect installation can render your website inoperable.

add_filter('woocommerce_billing_fields', 'wtd_custom_billing_fields', 1000, 1);
function wtd_custom_billing_fields( $fields ) {
$fields['billing_email']['required'] = true;
$fields['billing_phone']['required'] = true;

return $fields;

Was this article helpful?

No 0

About the Author

Christian Mayne is a full time WordPress developer and consultant based in the UK. He runs a UK based WordPress development agency with clients all over the World. As well as WordPress development, Christian has been teaching WordPress use and development since 2014 in classroom settings and online.