• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WP Desk = premium plugins for WordPress & WooCommerce
  • Plugins
        • Checkout & OrdersMake your work easier and automate the orders. Adjust the order form to your needs and make it more useful to your customers. Print order labels directly from WooCommerce. Put the orders in order using our plugins. Find out how to streamline the procurement process in your store.
          • Flexible Checkout Fields
          • Active Payments
          • Automatic Payment Status
          • Flexible Refund and Return Order
          • Print Orders and Address Labels
          • Flexible Subscriptions Recurring Shipping
          • Flexible Subscriptions Payment Retry
          • Flexible Subscriptions Stock Management
        • ProductsThese plugins will help you manage your WooCommerce products. Here you will find the plugins to import and update products from XML or CSV files. Then you can change the product unit of measure, show the lowest price in the last 30 days (Omnibus Directive), or let customers name the product price!
          • Flexible Product Fields
          • Dropshipping Import Products
          • Dropshipping FTP Import Products
          • Dropshipping Export Products
          • Custom Price
          • WP Desk Omnibus
          • Flexible Quantity Calculator
          • Dropshipping Orders Export
        • MarketingPromote your store online. Add products from your shop to price comparison websites directly from WooCommerce. Acquire new customers and communicate with your existing ones. Build a customer base and communicate with clients using one of the most effective marketing tools, namely e-mail marketing. Check out our promotional tools!
          • Flexible Pricing
          • Flexible Wishlist - Analytics & Emails
          • OLX WooCommerce
          • Flexible PDF Coupons
          • ShopMagic
          • Flexible Invoices
  • Bundle🔥
  • WP Desk Care
  • Support
  • Blog
  • My Account
  • 0

More results

Save custom checkout fields using woocommerce_checkout_update_order_meta

Checkout, Tech Posts, WooCommerce checkout fields

WP Desk2 minutes read2025-08-20
blog category heading image

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.

Contents

  • What is checkout customization in WooCommerce and how is order data processed?
  • How to add and save custom fields using code in WooCommerce?
    • 1. Add the custom fields to the checkout form
    • 2. Save the field values to the order meta
  • Why use Flexible Checkout Fields PRO instead of writing custom code?
  • woocommerce_checkout_update_order_meta vs plugin: which method should you choose?
    • Summary

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.

The below code with 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;
}
Adding custom fields to WooCommerce checkout form example
Adding custom fields to WooCommerce checkout form example

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.

Custom text and textarea example in the order details
Custom text and textarea example in the order details
You may also customize the code to validate data or allow its editing with 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.

Adding custom fields to WooCommerce checkout form with Flexible Checkout Fields PRO example
Adding custom fields to WooCommerce checkout form with Flexible Checkout Fields PRO example
There’s a free version available on WordPress.org: Flexible Checkout Fields – Free, which is perfect for basic field management. However, the PRO version gives you far more flexibility.
Display fields on specific pages - plugin settings in Flexible Checkout Fields WooCommerce
Display fields on specific pages - plugin settings in Flexible Checkout Fields WooCommerce

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
    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
    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.

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.

2 minutes read14090 views

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

WP Desk

...

Powered by WP Desk

WP Desk brings you great WooCommerce plugins. We strive to save your time and money by speeding up your processes. Use our plugins to build a better store. Awesome support included in the package.

Premium WooCommerce Plugins →
WP Desk › Blog › WooCommerce checkout & orders › WooCommerce checkout fields › Save custom checkout fields using woocommerce_checkout_update_order_meta

Primary Sidebar

Contents

  • What is checkout customization in WooCommerce and how is order data processed?
  • How to add and save custom fields using code in WooCommerce?
    • 1. Add the custom fields to the checkout form
    • 2. Save the field values to the order meta
  • Why use Flexible Checkout Fields PRO instead of writing custom code?
  • woocommerce_checkout_update_order_meta vs plugin: which method should you choose?
    • Summary

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: 80,000+ | WordPress Rating:

Add to cart or View Details
WP Desk
80,000+ Active Installations
Last Updated: 2026-08-20
Works with WooCommerce 10.7 - 11.1

Stay updated on our how-to articles

WP Desk news, WooCommerce tips, promo codes - right to your inbox.

By entering your e-mail, you agree to our Terms & Conditions and Privacy Policy.

By entering your e-mail, you agree to our Terms & Conditions and Privacy Policy.

Footer

WP Desk - WooCommerce Plugins

At WP Desk we create great WooCommerce plugins with awesome support. Save time and money with our e-commerce solutions. See how we can help you improve your e-store →

Secured by Comodo

WP Desk

  • About us
  • Giving Back
  • Blog
  • Get Support
  • Contact us

Products

  • Premium Plugins
  • WP Desk Care
  • Documentation
  • WooCommerce Invoices
  • Email Marketing
  • PDF Coupons

Legal

  • Terms & Conditions
  • Refund Policy
  • Support Policy
  • Privacy Policy

© 2026 WP Desk

We value your privacy

We use necessary cookies to make our site work. We'd also like to set additional cookies to understand site usage, enhance your browsing experience, and serve personalized ads or content. By clicking ‘Accept All,’ you consent to our use of additional cookies.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}