Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
WooCommerce Plugin Development

Adding Custom Registration Fields

Collect extra customer data during account registration.

Adding Custom Registration Fields — a practical guide to WooCommerce registration fields with clear examples you can reuse in real projects.

WooCommerce Plugin Development Series (20/101). Prefer one article? Read the complete WooCommerce plugin development tutorial.

Short description

Add fields to the registration form, validate them, and save to user meta.

Registration field save

add_action('woocommerce_created_customer', function ($customer_id) {
    if (isset($_POST['acme_company'])) {
        update_user_meta(
            $customer_id,
            'acme_company',
            sanitize_text_field(wp_unslash($_POST['acme_company']))
        );
    }
});

Leave a reply

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