WooCommerce will charge Canadian sales tax correctly, but only after four store-wide settings that decide every calculation before a single rate exists — and one column, Priority, that determines whether a Quebec order collects QST or silently drops it. This is a configuration guide for the WooCommerce tax engine. It is not tax advice. Which taxes you must register for, which rate applies to which product, and what today’s percentages are belong to your accountant, to Revenu Québec, and to the Canada Revenue Agency. Those obligations and those numbers change, and WordPress does not know when they do. Every percentage below is an illustrative example to confirm against your accountant’s written list, never a current authoritative figure. What follows is how to make WooCommerce apply whatever rates that list gives you.
What you’ll accomplish
- Lock the store-wide settings — price entry, address basis, shop base address, rounding — before any rate exists, so you never redo the table
- Build a rate table covering all thirteen provinces and territories in their three distinct shapes
- Get Quebec right: GST and QST as two separate order lines at two different priorities
- Load the table from CSV instead of hand-typing seventeen rows into a browser grid
- Confirm the result with test orders to three provinces, read straight off the orders
Prerequisites
- WooCommerce 9.x or 10.x on WordPress 6.5+. The tax settings screen, the rate table columns, and the CSV importer have been stable across many major versions.
- An administrator account, and a staging copy. Changing Prices entered with tax on a live store reinterprets every price you have already entered, with no undo.
- The rates in writing from your accountant, plus which products are standard-rated, reduced-rated, or zero-rated. You cannot derive that from the catalogue.
- SSH and WP-CLI for verification. The browser path works but leaves you nothing to check afterwards.
- Know whether a tax-service plugin is active. WooCommerce Tax, Avalara and similar plugins bypass the manual rate table entirely, so deactivate them on staging first or you will be tuning a table nothing reads.
- HPOS does not change any of this. Order tax lines live in
wp_woocommerce_order_itemsandwp_woocommerce_order_itemmetaeither way.
How it works
Every calculation starts from one address — the taxable address — and ends with tax lines attached to the order. In between, WooCommerce collects every rate row whose location columns match that address, groups them by Priority, and keeps exactly one row per priority. That sentence is the whole article. Two rows sharing a priority is not “both apply”; it is “one applies and the other disappears without an error, a warning, or a log entry.”
Matching works on four location columns — Country code, State code, Postcode / ZIP, City — and an empty column is a wildcard, not a mismatch. Country CA with a blank state matches every Canadian address; country CA with state ON matches only Ontario. With both in the table at the same priority, the more specific row wins: the province row beats the country wildcard. Postcode and city narrow further, and the postcode column accepts comma-separated lists and wildcards.
Two equally specific rows at the same priority is the case with no good answer. WooCommerce breaks that tie on the rows’ internal insertion order, which is not visible or stable in the admin grid. Never build a table that depends on it.
Compound is a separate axis from priority. A non-compound rate is calculated on the line item’s own total; a compound rate is calculated on the line total plus the non-compound tax already applied — tax on tax. Priority decides which rows survive, compound decides what base the survivors multiply. Quebec is where this gets mis-set: QST was compounded on GST historically, but that stopped in 2013, so QST applies to the pre-GST selling price and Compound stays unchecked. Confirm with your accountant, then leave the box alone.
Step-by-step
-
Turn taxes on and set the shop base address. At WooCommerce → Settings → General, tick Enable taxes and save. A Tax tab appears. On the same screen set Store Address to the address you actually operate from — this is the “shop base address” referenced throughout the tax settings, and the fallback when a customer address is unknown. Confirm:
wp option get woocommerce_calc_taxes wp option get woocommerce_default_countryExpected output is
yesand aCA:QC-shaped value naming your own province. -
Set the four options that decide everything. On WooCommerce → Settings → Tax:
- Prices entered with tax — for Canadian retail this is almost always “No, I will enter prices exclusive of tax”, because the tax is added at checkout rather than baked into the shelf price. Decide once. Flipping it later re-prices nothing; it re-interprets every number already stored in your products.
- Calculate tax based on — “Customer shipping address” is the default and the right answer for goods shipped in Canada, since place of supply follows delivery. Note the fallback: when a cart needs no shipping at all (a downloads-only order) there is no shipping address, and WooCommerce uses the billing address instead.
- Shipping tax class — leave it on “Shipping tax class based on cart items” unless your accountant says otherwise, so freight inherits the treatment of what is in the cart.
- Rounding — “Round tax at subtotal level, instead of rounding per line” is off by default, meaning tax rounds per line and the roundings sum; on, it rounds once on the subtotal. They differ by cents on multi-line orders, and your accountant’s reconciliation assumes one of them. Pick before you have orders.
-
Decide the tax classes. The Additional tax classes box ships with
Reduced rateandZero rate, one per line, and each class gets its own rate table tab. Add a class only when a group of products genuinely takes different rates — zero-rated basic groceries is the common Canadian case, and your accountant names the qualifying SKUs. Assign per product under Product data → General → Tax class, or in bulk from the Products list. Classes are not fallbacks for one another, so a class whose table is empty charges zero tax and looks like it worked. -
Write the rate rows in their three Canadian shapes. Every province and territory falls into one of three patterns, and the row count follows from which:
- Federal rate only — Alberta and the three territories. One row per province code, priority 1, tax name
GST. - HST — the participating provinces harmonise the federal and provincial components into one rate administered as a single tax. That is one row, priority 1, name
HST. Adding a separate federal row on top is double taxation, and it is the most common Canadian rate-table error we see. - Federal plus a provincial tax — Quebec, British Columbia, Saskatchewan and Manitoba charge federal GST alongside their own provincial tax. That is two rows for the same province code:
GSTat priority 1, the provincial tax at priority 2. In Quebec the second isQST.
That is seventeen rows for full national coverage. A shorter form exists — one country-wide wildcard federal row at priority 1, overridden province by province by the more specific HST rows — and it does work, because the specificity rule resolves it. Ship the explicit version anyway: seventeen readable rows can be diffed against your accountant’s list, an implicit override rule cannot.
- Federal rate only — Alberta and the three territories. One row per province code, priority 1, tax name
-
Build the CSV from an export, not a blank file. Open WooCommerce → Settings → Tax → Standard rates, use Insert row to enter one row by hand, then click Export CSV. That file is the authoritative header row for your version. On current WooCommerce it looks like this:
"Country Code","State Code","ZIP/Postcode","City","Rate %","Tax Name","Priority","Compound","Shipping","Tax Class" "CA","AB","","","5.0000","GST","1","0","1","" "CA","ON","","","13.0000","HST","1","0","1","" "CA","QC","","","5.0000","GST","1","0","1","" "CA","QC","","","9.9750","QST","2","0","1",""Priorityis the field from the diagram,Compoundis0or1, andShippingis1when the rate applies to shipping charges as well as products. The percentages are placeholders from a plausible configuration — replace all of them with your accountant’s numbers, and treat none of them as current. -
Import into the right class. Below the rate table click Import CSV, upload, and confirm the delimiter matches what your spreadsheet wrote — a French-locale Excel export uses semicolons and otherwise lands the whole row in the first column. Start the import from the rate table of the class you are loading, since the importer inherits that class. The importer appends rather than replaces, so re-running it duplicates every row; clearing first means selecting all rows and using Remove selected row(s).
-
Handle shipping and digital goods deliberately. The per-row
Shippingcolumn and the store-wide Shipping tax class setting are different controls, and both must agree with your accountant’s position on whether freight is taxable. For downloadable products, remember the fallback from step 2: with no shipping address in play the billing address becomes the taxable address, so test that path explicitly rather than assuming the physical-goods test covers it.
Validate it works
Read the table back out of the database, which shows what WooCommerce stored rather than what the grid renders:
wp db query "SELECT tax_rate_country, tax_rate_state, tax_rate, tax_rate_name, tax_rate_priority, tax_rate_compound, tax_rate_shipping FROM wp_woocommerce_tax_rates ORDER BY tax_rate_country, tax_rate_state, tax_rate_priority;"
Expected output is seventeen rows for full national coverage and, critically, no province code appearing twice at the same tax_rate_priority. If QC shows two rows both at priority 1, fix that before testing anything else.
Confirm the store-wide options landed:
wp option get woocommerce_prices_include_tax
wp option get woocommerce_tax_based_on
wp option get woocommerce_tax_round_at_subtotal
wp option get woocommerce_tax_total_display
Expected output for a typical Canadian retail store: no, shipping, no, itemized. The last matters for Quebec — single merges GST and QST into one displayed number, which customers and auditors both dislike.
Now place three test orders on staging: one shipping to a GST-only province, one to an HST province, one to Quebec. Then read their tax lines:
wp db query "SELECT i.order_id, i.order_item_name, MAX(CASE WHEN m.meta_key='rate_percent' THEN m.meta_value END) AS pct, MAX(CASE WHEN m.meta_key='tax_amount' THEN m.meta_value END) AS tax, MAX(CASE WHEN m.meta_key='shipping_tax_amount' THEN m.meta_value END) AS ship_tax FROM wp_woocommerce_order_items i JOIN wp_woocommerce_order_itemmeta m ON m.order_item_id = i.order_item_id WHERE i.order_item_type = 'tax' AND i.order_id IN (101,102,103) GROUP BY i.order_item_id ORDER BY i.order_id;"
Substitute your own order IDs. The shape is the point: one tax row for the GST-only order, one for the HST order, and two for the Quebec order with GST and QST as separate order_item_name values. A Quebec order returning one row is the priority collision, whatever the total says.
Troubleshooting
Quebec orders charge GST but no QST. Both rows sit at the same priority. Set the QST row to priority 2 and re-run the Quebec test order. Existing orders are not recalculated — they keep the tax computed at checkout — so a period of under-collected orders is a conversation with your accountant, not a setting.
A province is taxed twice. Almost always an HST province that also matches a country-wide federal wildcard row at a different priority, or an explicit federal row someone added for consistency. Query the table for that state code and confirm exactly one row exists at priority 1.
Rates changed in the database but the cart shows old numbers. WooCommerce caches matched rates behind a transient version that only invalidates on edits made through the admin or the importer. Direct SQL edits do not bump it:
wp eval 'WC_Cache_Helper::get_transient_version( "taxes", true );'
wp transient delete --all
Expected output is silence from the first and a success line from the second. Reload the cart in a fresh private window afterwards, or page caching and cart fragments will hand you a stale total.
Every product price changed after saving the tax screen. Prices entered with tax was flipped. WooCommerce did not alter stored prices, it changed what they mean, so an exclusive-price catalogue read as inclusive now shows lower pre-tax amounts. Set it back and make that decision on staging.
Tax is right in the cart and wrong on the order. Compare the saved shipping address to the one used at checkout, then check whether the order used local pickup — in stock WooCommerce those are taxed at the shop base address rather than the customer address, correct behaviour that surprises people.
When this is the wrong approach
A manual rate table suits a store selling into Canada with a rate list that changes once or twice a year. If you also sell into US states, the table has no concept of economic nexus thresholds and per-state rules shift often enough that hand-maintenance becomes its own job — a calculation service is the honest answer, and WooCommerce tax setup across US, Canadian and EU stores covers that comparison.
A configured table is also not a filing process. WooCommerce reports what it charged; it does not know what you owe, when you must register, or whether a rate moved last quarter. That reconciliation stays with your accountant, with Revenu Québec for QST, and with the Canada Revenue Agency for GST and HST. Re-read the opening: nothing here is tax advice, and every percentage in it is an example to be replaced.
If you are loading products alongside rates, importing WooCommerce products from CSV covers the Tax class column that binds each product to the tables you just built. The settings screens themselves are catalogued in the WooCommerce documentation.
Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.