PluginGauge

How to add a VAT number field to WooCommerce B2B registration

By Raz Technologies · published · data updated

How do I add a VAT number field to B2B customer registration in WooCommerce?

Use a B2B registration plugin that adds a VAT number field (6 of the 15 we track document one, 5 also document validating it, 3 explicitly against the EU VIES service) or add the field with three WooCommerce hooks (below) if a format check is enough. As of 2 November 2026, the top-ranked plugin in our B2B registration ranking is EU/UK VAT Validation Manager for WooCommerce (79.0/100). See our B2B registration plugin ranking for the full comparison.

The problem

B2B stores in the EU need a customer's VAT number to sell without VAT under the reverse charge, and often want to check it before approving the account. WooCommerce's registration form has only an email and a password.

Option 1: a plugin (no code)

These ranked B2B registration plugins document a VAT number field (evidence: Documented, from each plugin's readme or listing). Open a profile to see whether the plugin only stores the number or validates it, and the vendor's exact wording.

Plugins documenting a VAT number field — from our b2b registration ranking, 2 Nov 2026
PluginRankFeature inCheckout BlocksInstalls
EU/UK VAT Validation Manager#1Free versionNot declared7,000+
Kybernaut IČO DIČ#2Free versionNo2,000+
B2BKing#3Paid versionNot declared10,000+
WooCommerce B2B#4Paid versionNot declaredNo data
EU VAT Guard#8Free versionNot declared300+
WooCommerce Eu Vat & B2B#10Paid versionNot declaredNo data

Need other fields too (company name, tax certificate upload) or approval before first order? 8 plugins we track document extra registration fields (3 in the free version):

Plugins documenting extra registration fields — from our b2b registration ranking, 2 Nov 2026
PluginRankFeature inCheckout BlocksInstalls
B2BKing#3Paid versionNot declared10,000+
WooCommerce B2B#4Paid versionNot declaredNo data
Whols#5Free versionNot declared3,000+
Registration Fields Plugin#6Paid versionNot declaredNo data
EU VAT Guard#8Free versionNot declared300+
WooCommerce User Registration Plugin: Custom Fields, validate login & customer roles#11Paid versionNot declaredNo data
Custom Fields Account Registration#14Free versionNot declared700+
User Registration#15Paid versionNot declaredNo data

Option 2: three hooks (for developers)

This adds an optional VAT number field to the My Account registration form, checks its format (two-letter country prefix plus 2–13 characters) and saves it on the customer. It does not check the number with VIES.

// 1. Show the field
add_action( 'woocommerce_register_form', function () { ?>
    <p class="form-row form-row-wide">
        <label for="reg_vat_number"><?php esc_html_e( 'VAT number', 'my-store' ); ?></label>
        <input type="text" class="input-text" name="vat_number" id="reg_vat_number"
            value="<?php echo esc_attr( wp_unslash( $_POST['vat_number'] ?? '' ) ); ?>" />
    </p>
<?php } );

// 2. Check the format
add_filter( 'woocommerce_registration_errors', function ( $errors ) {
    $vat = strtoupper( preg_replace( '/[^A-Za-z0-9]/', '', wp_unslash( $_POST['vat_number'] ?? '' ) ) );
    if ( '' !== $vat && ! preg_match( '/^[A-Z]{2}[A-Z0-9]{2,13}$/', $vat ) ) {
        $errors->add( 'vat_number', __( 'Enter the VAT number with its country prefix, e.g. DE123456789.', 'my-store' ) );
    }
    return $errors;
} );

// 3. Save it on the new customer
add_action( 'woocommerce_created_customer', function ( $customer_id ) {
    $vat = strtoupper( preg_replace( '/[^A-Za-z0-9]/', '', wp_unslash( $_POST['vat_number'] ?? '' ) ) );
    if ( '' !== $vat ) {
        update_user_meta( $customer_id, 'vat_number', sanitize_text_field( $vat ) );
    }
} );

Make sure "Allow customers to create an account on the My account page" is on (WooCommerce → Settings → Accounts & Privacy), then register a test account.

What to check before you choose

Other plugins people ask about

FAQ

Can WooCommerce check that a VAT number is valid?

Not by itself. Checking a number against the EU's VIES service needs a plugin or custom code: 3 of the 15 B2B registration plugins we track document VIES validation, 3 of them in the free version (as of 8 November 2026). The code above only checks the format.

Can I approve B2B accounts by hand before they can order?

Yes, with a plugin: 10 of the 15 B2B registration plugins we track document admin approval of new accounts, 3 of them in the free version (as of 8 November 2026).

Where is the VAT number stored?

With the snippet above, as user meta (vat_number) on the customer. Plugins usually also show it in the admin user screen and copy it to orders; check that if your invoices need it.