I’m curious to know how many had the same problem. On the WooCommerce Checkout page, some user fields such as billing_name, shipping_address_1, etc. are automatically saved into the “WordPress User Profile” data upon processing.
But what if we also wanted to display and save another existing user field, such as “user_twitter“, or “user_url“, which you can find in the WP User Profile by default?
Well, this is very easy: first, we add a custom checkout field; then, we make sure that when the checkout is processed we save that field correctly.
Enjoy!

PHP Snippet: Show & Save WordPress User Field Upon WooCommerce Checkout
/**
* @snippet Display & Save WP User Field @ Checkout - WooCommerce
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 9
* @community https://businessbloomer.com/club/
*/
// ------------------------
// 1. Display field @ Checkout
add_action( 'woocommerce_after_checkout_billing_form', 'bbloomer_add_user_field_to_checkout' );
function bbloomer_add_user_field_to_checkout( $checkout ) {
$current_user = wp_get_current_user();
$saved_url = $current_user->user_url;
woocommerce_form_field( 'user_url', array(
'type' => 'text',
'class' => array( 'user_url form-row-wide' ),
'label' => 'Website URL',
'placeholder' => 'https://yoursite.com',
'required' => false
),
$saved_url );
}
// ------------------------
// 2. Save Field Into User Meta
add_action( 'woocommerce_checkout_update_user_meta', 'bbloomer_checkout_field_update_user_meta' );
function bbloomer_checkout_field_update_user_meta( $user_id ) {
if ( $user_id && $_POST['user_url'] ) {
$args = array(
'ID' => $user_id,
'user_url' => esc_attr( $_POST['user_url'] )
);
wp_update_user( $args );
}
}
Thanks for snippet Rodolfo, works perfect!
I’ve changed type “text” for “radio” but the value is not save:
Any ideas?
I am interested in Customize Woo, will I learn in the course to include fields anywhere in Woocommece??
Thank you so much.
Hello Jesus, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
(CustomizeWoo is about overall WooCommerce customization so this would be very specific. However, you get unlimited support from me and can share code, so I would be able to help you)
What if i want to save the changes to all of the fields made from the checkout to the user profile, do i have to list them all in the ‘bbloomer_checkout_field_update_user_meta’?
For ex if i change the name/last name/adress/phone in the checkout page they are not reflected in the user profile.
Uhm there is something strange then. Disable all plugins but Woo and try again
Useful snippet. But is it possible to retrieve the user meta from the WordPress user profile to a custom checkout field ( just reverse of the technique you described)?
Hi Sheikh, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
I replaced all instances of user_url with bob and it didn’t save anything to the database. What am I doing wrong?
Hello Chris, thanks for your comment! I’ve revised the snippet – let me know if this version works 🙂
Hi
Thanks for sharing but I think it won’t work with dropdown fields right?
Hey Robert – thanks so much for your comment! The “woocommerce_form_field” function can also generate a dropdown, so you can definitely save that data as well 🙂
Thank you for the useful snippet – awesome stuff!
FYI – there’s an “}” under the “// 1. Display field @ Checkout”-section.
Thank you so much Kasper 🙂