Title: Reordering fields
Last modified: August 30, 2016

---

# Reordering fields

 *  Resolved [ikramy](https://wordpress.org/support/users/ikramy/)
 * (@ikramy)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/reordering-fields-1/)
 * Hi,
 * I’m trying to order the checkout fields. Everything works fine except the order
   of the password field.
 * The result I get is:
    1- The order of the password field is not changing. 2- 
   I get a new field under the email field!
 * Code below. Any idea?
    Thanks
 *     ```
       add_filter("woocommerce_checkout_fields", "order_fields");
   
       function order_fields($fields) {
   
           $order = array(
               "billing_first_name",
               "billing_last_name",
               "billing_phone",
               "billing_email",
               "account_password",
               "billing_area",
               "billing_address_type",
               "billing_building",
               "billing_room",
               "billing_notes"
   
           );
           foreach($order as $field)
           {
               $ordered_fields[$field] = $fields["billing"][$field];
           }
   
           $fields["billing"] = $ordered_fields;
           return $fields;
   
       }
       ```
   
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

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

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/reordering-fields-1/#post-6516233)
 * This field is registered much later if needed. You’d have to use the woocommerce_checkout_init
   hook to move that up.
 *  Thread Starter [ikramy](https://wordpress.org/support/users/ikramy/)
 * (@ikramy)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/reordering-fields-1/#post-6516237)
 * Hi Mike,
 * Thanks for your response.
 * I tried:
    `do_action("woocommerce_checkout_init", "order_fields");`
 * instead of:
    `add_filter("woocommerce_checkout_fields", "order_fields");`
 * But it didn’t work!
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/reordering-fields-1/#post-6516240)
 * Its not a straight swap. The woocommerce_checkout_init hook passed different 
   args.
 * [https://github.com/woothemes/woocommerce/blob/9e41552342d07796d3ee5cefea76935288b65c6e/includes/class-wc-checkout.php#L98-L127](https://github.com/woothemes/woocommerce/blob/9e41552342d07796d3ee5cefea76935288b65c6e/includes/class-wc-checkout.php#L98-L127)

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

The topic ‘Reordering fields’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/reordering-fields-1/#post-6516240)
 * Status: resolved