Skip to content
Daniel Shaw · WordPress & WooCommerce Developer Wellington, New Zealand

👋 Not available for new client work right now!

Fixing New Zealand zone regions in WooCommerce 7.1.0 update


Please note: this issue was partly fixed in the WooCommerce 7.2.1 release, and completely resolved in the 7.2.2 release. The old zone region IDs will be automatically updated to the new format by clicking the “Update WooCommerce database” link that appears in your dashboard after updating the plugin.

What changed

WooCommerce 7.1.0 includes a change to how the "subdivision" codes for matching New Zealand regions are formatted. Section 7.1.0 2022-11-08 of the changelog contains the following item:

* Tweak - Update subdivision codes for New Zealand, to match current CLDR specification.

What broke

Before updating, regions in the below image are visibly assigned to a “North Island” zone name:

Screenshot of zone regions configured prior to updating to WooCommerce 7.1.0
Zone regions configured prior to updating to WooCommerce 7.1.0

…but zone regions are no longer assigned after updating to WooCommerce 7.1.0.

Screenshot of zone regions missing after updating to WooCommerce 7.1.0
Zone regions missing after updating to WooCommerce 7.1.0

Why it broke

2–character IDs were previously used internally by WooCommerce to match New Zealand regions. This update introduces a new 3–character format without accounting for saved configurations using the old format.

For example, the zone region “Wellington” used to be assigned a code of WE. The recent WooCommerce update now assigns a code of WGN to this region.

This results in a mismatch of IDs where zone regions were assigned to a shipping zone prior to updating to WooCommerce 7.1.0. WooCommerce now attempts to match regions to the new codes, while previously-configured shipping zones continue to use the old codes.

How to fix

Here’s a couple of manual quick-fix options until WooCommerce (hopefully) adopts an automated solution:

Reassign regions

The most straightforward approach is to reassign the correct regions to each shipping zone manually. To do this, open each affected zone and set regions anew in the “Zone regions” field.

While doing this, it’s worth checking if the Country/State field under Store Address (see the General tab) also needs to be fixed.

Update region IDs

Another option is to update the database with the new codes. In the wp_woocommerce_shipping_zone_locations table, look for the location_code column containing the old format codes.

Here’s a before/after list of codes:

  • Northland. NL becomes NTL
  • Auckland. AK becomes AUK
  • Waikato. WA becomes WKO
  • Bay of Plenty. BP becomes BOP
  • Taranaki. TK becomes TKI
  • Gisborne. GI becomes GIS
  • Hawke’s Bay. HB becomes HKB
  • Manawatu-Wanganui. MW becomes MWT
  • Wellington. WE becomes WGN
  • Nelson. NS becomes NSN
  • Malborough. MB becomes MBH
  • Tasman. TM becomes TAS
  • West Coast. WC becomes WTC
  • Canterbury. CT becomes CAN
  • Otago. OT becomes OTA
  • Southland. SL becomes STL