Skip to content

Instantly share code, notes, and snippets.

Created July 25, 2013 16:25
Show Gist options
  • Save BFTrick/6081396 to your computer and use it in GitHub Desktop.
Save BFTrick/6081396 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'
Copy link

rrrhys commented Oct 11, 2016


Copy link

yratof commented Oct 26, 2016

"Does this work multilingual?" – yes it does, everything in the database is based on american english.

Copy link

japick commented Nov 14, 2016

Nice one!

Copy link

Hi there, where do I actually paste this coding to get it to work?!

Copy link

JoeyKhd commented Jun 8, 2017

Thanks for sharing!

Copy link

c9dd commented Sep 5, 2017


Copy link

Thanks great idea

Copy link

Exceptional! Thanks, BFTrick.

I paired this with the following quick tutorial about executing the code since I wasn't 100% confident:

Copy link

You are a legend mate...

Copy link

My Hero!

Copy link


Copy link

zhex900 commented Sep 20, 2018

Works like magic. Thanks!

Copy link

tecgal commented Oct 5, 2018

It took a second ... absolutely pure gold. Thank you!

Copy link

Thank you!! This helped me a lot and saved me so much time. I am grateful <3

Copy link

toniodz commented Feb 6, 2019

useful, thanks

Copy link

Saved me a lot of time. Thank you!

Copy link

Thanks. Still working as of now.

Copy link

This helped me thank you!

Copy link

Thanks, you have saved me a lot of work

Copy link


Copy link

how i am supposed to run this?

Copy link

Kral adamsın :)

Copy link

Deimz commented Aug 26, 2020

This looks like SQL, so you should run it in phpmyadmin or in you mysql console :)

Thanks bro !

Copy link

Thanks for this query, flipped all rows in wp_wc_product_meta_lookup to taxable but the products kept saying it wasn't taxable. This query solved my issue, great!

Copy link

Thanks! Found easily with a google search...

Copy link

Yup same

Copy link

Thanks !!!!

Copy link

Thanks! Was looking to write this myself and find the columns but 1 search query and google showed me the correct thing.
P.s. for people who are using object cache, the reason it won't add the taxes until you visited the problem is because you have to clean the Cache. This could be Reddis object cache or other caching plugins!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment