Skip to main content
Login Join
Snippet · PHP

Make Phone Number Mandatory at WooCommerce Checkout

Shared by Kamran Abdul Aziz · May 20, 2026 · @woocommerce_checkout_fields

1 copy
23 views
Back to Snippets

By default, the phone number field at WooCommerce checkout is optional. This snippet forces it to be required, so customers cannot complete an order without entering a valid phone number. Useful for store owners who need contact details for order follow-up or delivery coordination.

<?php

add_filter( 'woocommerce_checkout_fields', function( $fields ) {

	$fields['billing']['billing_phone']['required'] = true;

	$fields['billing']['billing_phone']['class']    = array( 'form-row-wide', 'validate-required', 'validate-phone' );

	$fields['billing']['billing_phone']['label']    = 'Phone';

	return $fields;

}, 9999 );