currently i add a custom billing field in woocommerce by

function custom_override_checkout_fields( $fields ) {
     $fields['billing']['billing_phone_new'] = array(
        'label'     => __('Phone 2', 'woocommerce'),
    'placeholder'  => _x('Phone 2', 'placeholder', 'woocommerce'),
    'required'  => false,
    'class'     => array('form-row-wide'),
    'clear'     => true

     return $fields;


i need to edit this field value in admin side . Currently i can edit all other values in billing address but this value is not appearing in admin section . I use the following code only for to see the value in admin section .

function order_phone_backend($order){
    echo "<p><strong>Billing phone 2:</strong> " . get_post_meta( $order->id, '_billing_phone_new', true ) . "</p><br>";

add_action( 'woocommerce_admin_order_data_after_billing_address', 'order_phone_backend', 10, 1 );

I read the documentation https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ . But everything in this document working correct expect billing_phone/Phone is note see under Custom field . I check the screen option but i already ticked custom field . Other custom field and its value are visible and editable .

How can i edit this value in back end . Please help .

  • The first code block in your question, modifies the default 'Phone no' field. It does not add any new field to checkout form. The checkout fields won't be available under "custom fields", so please don't search it there. If you want to edit any of the field from billing address or shipping address, go to backend and click on any order under order list. Then you will see a small edit icon besides 'Billing Details' and 'Shipping Details' headings. Clicking on that will allow you to edit those details. I hope this helps. Jan 22, 2016 at 8:06
  • Please check my code now
    – Ron
    Jan 23, 2016 at 7:51

2 Answers 2


The code you have provided is incomplete. Not sure if that is the only code you are using to achieve what you want. So, besides first code block which you have provided, bellow I am adding all rest of the code which is required to show the new field on backend in 'Order Details' box and make it editable through custom fields. Please note, in your second code block you have named the field key as _billing_new_phone. Any custom field key name which starts with _ (underscore) is a hidden custom field & won't show up on backend under "Custom Fields".

 * Process the checkout
add_action('woocommerce_checkout_process', 'my_custom_checkout_field_process');

function my_custom_checkout_field_process() {
    // Check if set, if its not set add an error.
    if ( ! $_POST['billing_phone_new'] )
        wc_add_notice( __( 'Phone 2 is compulsory. Please enter a value' ), 'error' );

 * Update the order meta with field value
add_action( 'woocommerce_checkout_update_order_meta', 'my_custom_checkout_field_update_order_meta' );

function my_custom_checkout_field_update_order_meta( $order_id ) {
    if ( ! empty( $_POST['billing_phone_new'] ) ) {
        update_post_meta( $order_id, 'billing_phone_new', sanitize_text_field( $_POST['billing_phone_new'] ) );

 * Display field value on the order edit page
add_action( 'woocommerce_admin_order_data_after_billing_address', 'my_custom_checkout_field_display_admin_order_meta', 10, 1 );

function my_custom_checkout_field_display_admin_order_meta($order){
    echo '<p><strong>'.__('Phone 2').':</strong> <br/>' . get_post_meta( $order->get_id(), 'billing_phone_new', true ) . '</p>';

WooCommerce does not make the new checkout field editable under its standard 'Order Details' box. It will be available as 'view only' mode in that box but you can edit the same through WordPress' standard custom fields block. See below screenshot.

enter image description here

  • ""Any custom field key name which starts with _ (underscore) is a hidden custom field & won't show up on backend under "Custom Fields". "" from where you get this information ?
    – Ron
    Jan 24, 2016 at 11:33
  • 2
    On WordPress codex. You may get more info here Jan 25, 2016 at 14:00
  • Please helpt solve my friend question stackoverflow.com/questions/49505056/…
    – Ron
    Mar 27, 2018 at 6:57
  • 2
    in my case,I got results by using get_post_meta( $order->get_id(), '_billing_phone_new', true ). I had to put underscore in front of variable name in get_post_meta function.
    – Dashrath
    May 19, 2019 at 16:58

Here is the solution : Accessing directly product data is not allowed, e.g.


The correct method going forward is:

  • How is this answering the question?
    – Tofandel
    May 21, 2020 at 9:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.