Customizing your WooCommerce checkout is a common need, especially when you want to collect extra details from your customers. Whether it’s a special note or a custom input like a delivery instruction, WooCommerce makes it possible to save these fields to the order. In this guide, you'll learn how to add two new fields and store their values using the woocommerce_checkout_update_order_meta
action. Plus, we’ll show how a plugin like Flexible Checkout Fields PRO can make it all easier.
Let’s walk step by step how to store custom order meta in WooCommerce.
What is checkout customization in WooCommerce and how is order data processed?
The WooCommerce checkout process involves several key steps. When a customer fills out the form and hits 'Place Order', WooCommerce validates the data, stores billing/shipping information, and triggers hooks that developers can use to store extra data.
By default, only standard fields like name, email, and address are saved.
But you can extend this using the woocommerce_checkout_fields
filter to add custom fields to the form.
Then, with the woocommerce_checkout_update_order_meta
action, you can save their values as order meta.
This is particularly useful when you want to include things like gift messages, delivery preferences, or custom instructions.
You can even display this data later in the admin panel, emails, or thank-you pages.
How to add and save custom fields using code in WooCommerce?
Let’s say you want to collect two pieces of additional information:
- A custom text input ("Custom Text")
- A textarea message ("Custom Message")
Here’s how to do it.
woocommerce_checkout_fields
and woocommerce_checkout_update_order_meta
actions should be added to the theme's functions.php to show new checkout fields and save the data as order meta.1. Add the custom fields to the checkout form
add_filter('woocommerce_checkout_fields', 'adding_custom_fields_to_form');
function adding_custom_fields_to_form($fields) {
$fields['billing']['custom_text_field'] = array(
'type' => 'text',
'label' => __('Custom Text', 'woocommerce'),
'placeholder' => __('You may enter a custom text here', 'woocommerce'),
'required' => false,
'priority' => 110,
'class' => array('form-row-wide'),
'clear' => true,
);
$fields['billing']['custom_message_field'] = array(
'type' => 'textarea',
'label' => __('Custom Message', 'woocommerce'),
'placeholder' => __('You may enter a custom message here', 'woocommerce'),
'required' => false,
'priority' => 120,
'class' => array('form-row-wide'),
'clear' => true,
);
return $fields;
}

2. Save the field values to the order meta
add_action('woocommerce_checkout_update_order_meta', 'saving_custom_form_fields');
function saving_custom_form_fields($order_id) {
if (!empty($_POST['custom_text_field'])) {
update_post_meta($order_id, '_custom_text_field', sanitize_text_field($_POST['custom_text_field']));
}
if (!empty($_POST['custom_message_field'])) {
update_post_meta($order_id, '_custom_message_field', sanitize_textarea_field($_POST['custom_message_field']));
}
}
add_action( 'woocommerce_admin_order_data_after_billing_address', 'adding_custom_form_fields_to_admin_order_meta', 10, 1 );
function adding_custom_form_fields_to_admin_order_meta($order){
echo '<div><p class="form-field form-field-wide"><strong>'.__('Custom text').':</strong> <br/>' . get_post_meta( $order->get_id(), '_custom_text_field', true ) . '</p>';
echo '<<p class="form-field form-field-wide"><strong>'.__('Custom textarea').':</strong> <br/>' . get_post_meta( $order->get_id(), '_custom_message_field', true ) . '</p></div>';
}
Now, both fields will appear in the admin panel under the order's custom fields.

woocommerce_wp_text_input
and woocommerce_wp_textarea_input
functions in the order details inside the div with class="edit_address" so its hidden before editing.This approach works well, but requires some coding knowledge.
It also has limitations when it comes to validation, field types, or displaying data conditionally.
That’s where Flexible Checkout Fields comes in.
Why use Flexible Checkout Fields PRO instead of writing custom code?
While coding your own fields and saving them with the woocommerce_checkout_update_order_meta
action gives you full control, it's not always the most efficient or safe solution, especially for non-developers.
That’s where the Flexible Checkout Fields plugin becomes an easier and faster option.


Here are 5 standout features that make Flexible Checkout Fields PRO worth using:
- Drag & drop field manager – No need to write PHP functions. Simply drag and reorder fields directly in the WordPress admin.
- Field types variety – Add text, textarea, select, radio, checkbox, date picker, time, and more.
- Display rules – Show or hide fields based on selected shipping/payment method or cart conditions.
Conditions for custom form fields in Flexible Checkout Fields PRO WooCommerce - Predefined validation – Easily set required fields and use built-in validation options without custom functions.
- Pricing – Additional price per checkout fields.
Additional pricing per form field example in Flexible Checkout Fields PRO WooCommerce
Instead of manually registering fields and saving meta data with woocommerce_checkout_update_order_meta
, you get a full interface.
Plus, all the saved field values appear neatly in the order summary and emails.
If you're looking for a long-term, scalable solution to handle custom checkout fields and save data to order meta, this plugin saves hours of coding and maintenance.
Flexible Checkout Fields PRO WooCommerce $59
Edit, add new or hide unnecessary fields from the WooCommerce checkout form. Add pricing to fields and use conditional logic. It's all about conversions and better user experience. NEW: now you can set multiple conditions (OR) under one or more condition groups (AND).
💾 Active Installations: 90,000+ | WordPress Rating:
woocommerce_checkout_update_order_meta vs plugin: which method should you choose?
If you’re building a custom integration or have very specific requirements, then woocommerce_checkout_update_order_meta
combined with woocommerce_checkout_fields
is a powerful and reliable way to go.
However, if you want an easier way to customize your checkout and avoid code entirely, the Flexible Checkout Fields plugin is a must-have.
It speeds up your workflow and removes the guesswork from editing your WooCommerce checkout.
Summary
- Use
woocommerce_checkout_fields
to add new checkout fields. - Use
woocommerce_checkout_update_order_meta
to save those fields to order meta. - Custom code gives flexibility but requires ongoing support and testing.
- Flexible Checkout Fields PRO lets you manage fields visually with advanced options.
- There’s a free version too if you only need basic field editing.