If you’ve ever worked (or are working, good luck!) on a Magento product, and have already added in all of your products either by hand or importing, you know how tedious it is to go through each one again and set the tax rates or class on every single item. Here’s a short and simple solution that will allow you to change the tax class on all of your products by use of a MySQL query, to simply bulk update a tax class in Magento.
First off, get in to your database and find your eav_attribute table. Within this table, look for your tax_class_id row, and find the corresponding value (mine was 81 on one project, and 85 on another, so numbers may vary!)
Once you’ve found the corresponding values here, check the tax_class table to see which Tax Class ID you are using (2 is Taxable Goods in this case, which is what I stuck with). Make sure you are finding the value that you want your class to be, so if you created a new one, set one product and find it here.
Once you have this value (we’ll stick with 85 in this post), we can begin writing our SQL query that will update all of our products to our new Taxable Goods class.
**Note – if you are using table prefixes, do NOT forget to add the prefix in front of catalog_product_entity_int table name below**
UPDATE catalog_product_entity_int SET value=2 WHERE attribute_id=85
Once you run this, head back over to Magento and rebuild your indexes just to be safe. Once you’ve cleared the cache and rebuilt indexes, you should be able to check out your products and they should indeed have your desired tax class set!
Another note to mention – this will update ALL products, including Bundles/Configurable products/etc.