WooCommerce Subscriptions Tax Retrofit: Migrate Your VAT-Inclusive Subscriptions to Net Price + VAT
Just crossed the VAT threshold and need to convert your WooCommerce Subscriptions from tax-inclusive prices to a net price plus VAT? My plugin automates the migration of hundreds of subscriptions in a matter of minutes, without changing what your customers pay. It works with any VAT rate.
A Call for Help
A few days ago, I got a message from a friend who runs her own business. Her company, which sold subscriptions through WooCommerce, had just hit an important milestone: the revenue threshold that required her to start collecting VAT. Good news for the business, but an immediate technical headache for her online store.
Her hundreds of existing subscriptions were stored with tax-inclusive prices and no tax breakdown whatsoever. In WooCommerce, each line simply read “€30”: a single, monolithic amount with no distinction between the net price and the VAT. But the tax authorities now required invoices with VAT shown separately, so that €30 had to become “€25 before tax + €5 VAT = €30 total.”
Simple in theory. Except that WooCommerce Subscriptions, excellent as it is at handling recurring billing, was never designed for this scenario: retroactively breaking out VAT from prices stored as tax-inclusive. Without a technical solution, the only option left was doing it by hand: editing each subscription in the admin interface, recalculating the net price, assigning the correct rate, and checking the total. At five to fifteen minutes per subscription, a few hundred subscriptions add up to dozens of hours of repetitive work, with all the risk of human error that comes with it.
My friend had already started editing a few of them manually. After the third one, she realized it wasn’t sustainable and reached out to me.
From Quick Script to Full-Fledged Plugin
Having worked hands-on with WordPress for more than twenty years, I quickly pinned down the mechanics: in WooCommerce, a subscription is an order made up of line items (woocommerce_order_items), metadata (woocommerce_order_itemmeta), and tax rates (woocommerce_tax_rates). Each line item had to be converted through the WooCommerce API to split it into a net amount and VAT, while preserving the line item itself (its ID, tax class, and metadata), with the whole process wrapped in SQL transactions to guarantee data integrity.
What was supposed to be “a quick little script to help a friend” naturally grew into a genuine production-grade plugin. You don’t touch active subscriptions, and therefore real customers’ billing, without solid safeguards: robust error handling, SQL transactions with automatic rollback, double-checked rounding, a simulation mode strongly recommended before any real migration, detailed logs, CSV export for auditability, and, since version 1.4.5, a command that undoes the migration without having to restore a backup.
The result is WooCommerce Subscriptions Tax Retrofit, a plugin that goes through all of your subscriptions and, for each one, detects missing VAT, calculates the breakdown from the tax-inclusive price, converts the line items to the correct structure, and verifies that the amount the customer pays stays the same, within a rounding tolerance (one cent by default). If the difference is any larger, the changes to that subscription are rolled back. Everything is available through an interface built into the WordPress admin, or from the command line (WP-CLI) for scripted migrations.
The migration runs in the background, so you can close the page and come back later. Unpaid renewal orders that have already been created are converted along with their subscription, and the plugin refuses to start if your tables aren’t using InnoDB, since rollback wouldn’t work without it.
Available as Open Source
The source code, technical documentation, and full changelog are available on GitHub. That’s also where you’ll find the technical details, upcoming changes, and any contributions. Use version 1.4.5 or later: it has been tested with WordPress 7.1, PHP 7.4 through 8.5, WooCommerce 11.3, WooCommerce Subscriptions 9.4, and HPOS (High-Performance Order Storage). If this plugin helps you, great: fork it, improve it, adapt it to your needs. Just one essential reminder: back up your database before using it.
.