Magento – Batch / Bulk Edit Tax Class on All Products

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.

Posted in Magento, Magento Enterprise, Magento Professional, MySQL
  • Ciprian Pantea

    Also I’d like to add that my attribute_id was 121 and to find out which one is it for you, you can use this sql query:
    select * from eav_attribute where attribute_code like “%tax_class_id%”;

    Thank you for your solution!

  • andrewlancaster

    As easy as it gets. Thanks a million!

  • torbonaut

    thanks a bunch. 3k products done quickly.

  • Ron

    For anyone else doing this here is the easy way to find the attribute ID for the tax class.
    In your Admin Click on Categories > Manage Attributes.
    Mouse-over the Taxable Goods and the tooltip will show you the ID.
    My client’s was 122. 1921 products updated.

  • Merrill

    I’m editing products by means of desktop application called Store Manager for Magento. It works directly with database and can perform on the fly reindex. There is free trial of extension available for use for 2 weeks to verify if it’s convenient for you.

  • beau

    many many many thanks 😉

    • Glad I could help! How many products did you update with this?

  • Goofas

    Thanks! Massive time saver!

    • @Goofas, glad it saved you some time!

    • @Goofas, glad it helped and saved you some time!

  • Hedge

    Thank You!! This saved me hours. 300+ products.
    Thanks Again!

    • Anonymous

      Hey Hedge,

      Glad it helped! I just had to do this for a storefront of over 2,200 products, and saved both myself and the client tons of time!

  • Bootlegazn

    omg thank you so much!

    • Anonymous

      Bootleg, thank you for posting that it helped you! I’ve had this issue multiple times and these seems to do the trick every time.