Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Created July 25, 2013 16:25
Show Gist options
  • Select an option

  • Save BFTrick/6081396 to your computer and use it in GitHub Desktop.

Select an option

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'
@rrrhys
Copy link
Copy Markdown

rrrhys commented Oct 11, 2016

Legend

@yratof
Copy link
Copy Markdown

yratof commented Oct 26, 2016

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

@japick
Copy link
Copy Markdown

japick commented Nov 14, 2016

Nice one!

@amykallissa
Copy link
Copy Markdown

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

@JoeyKhd
Copy link
Copy Markdown

JoeyKhd commented Jun 8, 2017

Thanks for sharing!

@c9dd
Copy link
Copy Markdown

c9dd commented Sep 5, 2017

Thanks!

@ProgrammerNomad
Copy link
Copy Markdown

Thanks great idea

@MarkPraschan
Copy link
Copy Markdown

Exceptional! Thanks, BFTrick.

I paired this with the following quick tutorial about executing the code since I wasn't 100% confident:
http://support.hostgator.com/articles/how-to-run-sql-queries-in-phpmyadmin

@takisv76
Copy link
Copy Markdown

You are a legend mate...

@saibottrenham
Copy link
Copy Markdown

My Hero!

@akashjdongre
Copy link
Copy Markdown

awesome

@zhex900
Copy link
Copy Markdown

zhex900 commented Sep 20, 2018

Works like magic. Thanks!

@tecgal
Copy link
Copy Markdown

tecgal commented Oct 5, 2018

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

@anton-roos
Copy link
Copy Markdown

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

@toniodz
Copy link
Copy Markdown

toniodz commented Feb 6, 2019

useful, thanks

@unscripted
Copy link
Copy Markdown

Saved me a lot of time. Thank you!

@mio31337
Copy link
Copy Markdown

Thanks. Still working as of now.

@anton-roos
Copy link
Copy Markdown

This helped me thank you!

@curdaneta
Copy link
Copy Markdown

Thanks, you have saved me a lot of work

@brynzovskii
Copy link
Copy Markdown

Perfect!

@gagankhatri
Copy link
Copy Markdown

how i am supposed to run this?

@SeydaAsan
Copy link
Copy Markdown

Kral adamsın :)

@Deimz
Copy link
Copy Markdown

Deimz commented Aug 26, 2020

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

Thanks bro !

@Whendriksen-Spec
Copy link
Copy Markdown

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!

@RonR-WebDesign
Copy link
Copy Markdown

Thanks! Found easily with a google search...

@MilenFrom
Copy link
Copy Markdown

Yup same
KING :D

@davidebr90
Copy link
Copy Markdown

Thanks !!!!

@bartmolk
Copy link
Copy Markdown

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