Skip to content

Instantly share code, notes, and snippets.

@harishankerr
Last active May 2, 2017 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harishankerr/e4e04e37544724079fe08828550dda29 to your computer and use it in GitHub Desktop.
Save harishankerr/e4e04e37544724079fe08828550dda29 to your computer and use it in GitHub Desktop.
Remove Checkout Fields From WooCommerce Checkout
<?php // Use the PHP Tag only if needed
/*
Snippet to remove Company And Phone Fields From The Checkout Page In WooCommerce
---------------------------------------------------------------------------------
Please paste this code snippet at the bottom of the functions.php file in your theme, or use a Code Snippets Plugin (https://wordpress.org/plugins/code-snippets/)plugin to add this snippet.
*/
function wc_ninja_remove_checkout_field( $fields ) {
unset( $fields['billing']['billing_company'] ); // Removes the Company Field.
unset( $fields['billing']['billing_phone'] ); // Removes the Phone Field.
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'wc_ninja_remove_checkout_field' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment