Skip to content

Instantly share code, notes, and snippets.

@yratof
Forked from BFTrick/update-tax-status.sql
Created October 26, 2016 08:56
Show Gist options
  • Save yratof/52b62c6131ee8a1b9d98fa756621435d to your computer and use it in GitHub Desktop.
Save yratof/52b62c6131ee8a1b9d98fa756621435d to your computer and use it in GitHub Desktop.
Update the tax status of all WooCommerce products.
UPDATE `wp_postmeta`
SET meta_value='taxable'
WHERE meta_key='_tax_status'
@arpoodle
Copy link

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.

@MaxedOnline
Copy link

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