Make the Billing Phone Field Optional
Keeps the phone field on the classic checkout but no longer requires it.
Opens WPIDE on
Code
add_filter( 'woocommerce_billing_fields', function ( $fields ) {
if ( isset( $fields['billing_phone'] ) ) {
$fields['billing_phone']['required'] = false;
}
return $fields;
}, 20 );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.