Tax Exemption for WooCommerce

How can we help?

Search the documentation or ask the AI agent anything about the plugin.

Where exemption data is stored

Updated September 15, 2026

Exemption details are stored as user meta on the customer’s account and mirrored onto each order as order meta when it is placed. There are no custom database tables. Plugin settings live in a single option.

Settings

Every setting is stored in one serialised option, tefw_settings, keyed by setting name — tefw_enable, tefw_class, tefw_shipping_enable and so on. Read it with the plugin’s own helper so defaults are handled consistently:

$settings = tefw_get_settings();
$tax_class = isset( $settings['tefw_class'] ) ? $settings['tefw_class'] : 'Zero rate';

If you write to this option programmatically, read the existing array and merge into it. The settings screen is one form spanning every tab and its sanitiser rebuilds the option from scratch, preserving keys whose inputs were not rendered — overwriting the option wholesale will destroy configuration for tabs you were not looking at.

Customer data (user meta)

  • tefw_exempt — whether exemption is currently enabled on the account.
  • tefw_exempt_statusapproved, pending, declined or expired.
  • tefw_exempt_name and tefw_exempt_reason — the two built-in fields.
  • tefw_exempt_expiration — the expiration date.
  • tefw_exempt_file — the stored certificate file name.
  • tefw_exempt_statecity — the exemption city/state field.
  • tefw_tax_class — a per-customer tax class override.
  • tefw_exempt_custom_{id} — one entry per custom field, keyed by that field’s internal ID.

Registration number

  • tefw_exempt_reg_type — type slug, e.g. eu_vat, uk_vat, au_abn.
  • tefw_exempt_reg_number — the number as the customer entered it, trimmed.
  • tefw_exempt_reg_status — empty, valid, invalid, unverified, unavailable or error.
  • tefw_exempt_reg_checked — Unix timestamp of the last verification attempt.
  • tefw_exempt_reg_name — the name the register returned, where it gives one.
  • tefw_exempt_reg_consultation — the VIES or HMRC proof-of-check reference.
  • tefw_exempt_reg_method — how it was checked: format, checksum, vies, hmrc, abr or ccew.

Note the distinction between invalid and unavailable: the first means a register actively rejected the number, the second that it could not be reached. Only the first should ever be treated as the customer’s problem.

Order meta

The same keys are written to the order, so it is a snapshot of the details at the time of sale rather than a live view of the account. Alongside them:

  • is_vat_exempt — WooCommerce’s own flag.
  • tefw_exempt_customer — the customer the exemption belonged to.
  • tefw_checkout_disabled — set when the customer deliberately unticked exemption at checkout despite their account defaulting to exempt. This is what stops a later recalculation re-applying it.

Read order meta through the CRUD methods rather than get_post_meta() — the plugin declares compatibility with High-Performance Order Storage, so orders may not live in the posts tables:

$order = wc_get_order( $order_id );

if ( $order && $order->get_meta( 'tefw_exempt' ) ) {
    $reason = $order->get_meta( 'tefw_exempt_reason' );
    $number = $order->get_meta( 'tefw_exempt_reg_number' );
}

Product meta

tefw_exempt_product holds yes or no, marking a product as eligible when Specific products only is in use.

AvaTax

The integration reads and writes the AvaTax plugin’s own keys, wc_avatax_tax_exemption and wc_avatax_tax_exemption_pending, so the approved and awaiting-approval entity use codes stay separate.

Certificates on disk

Files are stored in wp-content/uploads/tax-exemption/ under a server-generated, unguessable name. Only the file name is held in meta. Build links with tefw_certificate_url() rather than constructing an uploads URL yourself — that function routes through the access-controlled handler.

Personal data

Exemption details are included in WordPress personal data exports and erasure requests, so a GDPR request covers them without extra work.

Related

Was this article helpful?