-
-
Save yratof/52b62c6131ee8a1b9d98fa756621435d to your computer and use it in GitHub Desktop.
Update the tax status of all WooCommerce products.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE `wp_postmeta` | |
SET meta_value='taxable' | |
WHERE meta_key='_tax_status' |
Remember to check your _tax-class
, if it contains a number that doesn't exist, no tax will be applied
Also, if a product has never been taxable, the meta_key '_tax_status' is not created for that product so there is no meta_value to update.
You need to find all products that have no meta_key of '_tax_status' in the wp_postmeta table too.
I've tried doing this, but it will only update 4 rows. Any idea on how to do this? I have limited coding experience
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change
wp_
to your own tax prefix