Title: Checkout Fields Not Removing
Last modified: January 31, 2019

---

# Checkout Fields Not Removing

 *  Resolved [sirbob77](https://wordpress.org/support/users/sirbob77/)
 * (@sirbob77)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/checkout-fields-not-removing/)
 * Whenever I try to hide a checkout field, like phone or company, it just moves
   that field below the last field in the checkout. The custom code I had is no 
   longer working. I’ve removed all checkout plugins and custom code and tried using
   the customize method to set the phone and company fields to “Hidden”, but it 
   just moves those fields to the bottom for some reason. This has only started 
   happening after the recent updates.
 * Any help would be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [con](https://wordpress.org/support/users/conschneider/)
 * (@conschneider)
 * Engineer
 * [7 years, 3 months ago](https://wordpress.org/support/topic/checkout-fields-not-removing/#post-11154729)
 * Hi there,
 * This should be a straightforward task with something such as:
 *     ```
       // Hook in
       add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
   
       // Remove the order comments field
       function custom_override_checkout_fields( $fields ) {
            unset($fields['order']['order_comments']);
   
            return $fields;
       }
       ```
   
 * Based on: [https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/](https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/)
 * I am marking this as resolved, but feel free to follow up or open a new thread
   anytime.
 *  Thread Starter [sirbob77](https://wordpress.org/support/users/sirbob77/)
 * (@sirbob77)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/checkout-fields-not-removing/#post-11155611)
 * Thanks. I have attempted this, but it says, “Your PHP code changes were rolled
   back due to an error on line 78 of file wp-content/themes/bridge/framework/modules/
   woocommerce/woocommerce-config.php. Please fix and try saving again.
 * Cannot redeclare custom_override_checkout_fields() (previously declared in wp-
   content/themes/bridge-child/functions.php:12)”
 * The file that is mentioned, on line 78, has the following:
 * function custom_override_checkout_fields($fields) {
    //billing fields $args_billing
   = array( ‘first_name’ => __(‘First name’,’qode’), ‘last_name’ => __(‘Last name’,’
   qode’), ‘company’ => __(‘Company name’,’qode’), ‘address_1’ => __(‘Address’,’
   qode’), ’email’ => __(‘Email’,’qode’), ‘phone’ => __(‘Phone’,’qode’), ‘postcode’
   => __(‘Postcode / ZIP’,’qode’), ‘city’ => __(‘Town / City’,’qode’), ‘state’ =
   > __(‘State’,’qode’) );
 *  //shipping fields
    $args_shipping = array( ‘first_name’ => __(‘First name’,’
   qode’), ‘last_name’ => __(‘Last name’,’qode’), ‘company’ => __(‘Company name’,’
   qode’), ‘address_1’ => __(‘Address’,’qode’), ‘postcode’ => __(‘Postcode / ZIP’,’
   qode’), ‘city’ => __(‘Town / City’,’qode’), ‘state’ => __(‘State’,’qode’) );
 *  //override billing placeholder values
    foreach ($args_billing as $key => $value){
   $fields[“billing”][“billing_{$key}”][“placeholder”] = $value; }
 *  //override shipping placeholder values
    foreach ($args_shipping as $key => $
   value) { $fields[“shipping”][“shipping_{$key}”][“placeholder”] = $value; }
 *  return $fields;
    }
 * Is there a means of working around this?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Checkout Fields Not Removing’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [checkout](https://wordpress.org/support/topic-tag/checkout/)
 * [remove](https://wordpress.org/support/topic-tag/remove/)

 * 2 replies
 * 2 participants
 * Last reply from: [sirbob77](https://wordpress.org/support/users/sirbob77/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/checkout-fields-not-removing/#post-11155611)
 * Status: resolved