Remove a particular field or all fields from the Woocommerce Form.

Remove a particular field or all fields from the Woocommerce Form.

Remove a particular field or all fields from the Woocommerce Form.

How to Remove a Particular Field or Fields Remove From Woocommerce?

If you are a new WordPress Developer and if you want to remove the Woocommerce field or some fields from a WordPress website. Here I submitted useful functional helpful code for WordPress Developer.

Anware :

[php]

////////////
// add_filter(‘woocommerce_checkout_fields’, ‘checkout_page_fields_filtering’);
// function checkout_page_fields_filtering($default){
// echo “<pre>”; print_r($default); “</pre>”;
// }
//////////////
// /**
// Remove a particular field or all fields from the Woocommerce Form.
// **/
add_filter( ‘woocommerce_checkout_fields’, ‘wc_remove_checkout_fields’ );
function wc_remove_checkout_fields( $fields ) {
//Billing fields
unset( $fields[‘billing’][‘billing_company’] );
unset( $fields[‘billing’][‘billing_email’] );
unset( $fields[‘billing’][‘billing_phone’] );
unset( $fields[‘billing’][‘billing_state’] );
unset( $fields[‘billing’][‘billing_first_name’] );
unset( $fields[‘billing’][‘billing_last_name’] );
unset( $fields[‘billing’][‘billing_address_1’] );
unset( $fields[‘billing’][‘billing_address_2’] );
unset( $fields[‘billing’][‘billing_city’] );
unset( $fields[‘billing’][‘billing_postcode’] );
//Shipping fields
unset( $fields[‘shipping’][‘shipping_company’] );
unset( $fields[‘shipping’][‘shipping_phone’] );
unset( $fields[‘shipping’][‘shipping_state’] );
unset( $fields[‘shipping’][‘shipping_first_name’] );
unset( $fields[‘shipping’][‘shipping_last_name’] );
unset( $fields[‘shipping’][‘shipping_address_1’] );
unset( $fields[‘shipping’][‘shipping_address_2’] );
unset( $fields[‘shipping’][‘shipping_city’] );
unset( $fields[‘shipping’][‘shipping_postcode’] );
//Order fields
unset( $fields[‘order’][‘order_comments’] );
return$fields;
}

[/php]

For Help Contact > Fiverr Saller