I’ve just updated my WooCommerce Shipping Classes to work better with free shipping on certain items.
However, I need to apply my new ‘Standard Shipping’ class to 1000+ Products. Going through Products > Bulk Edit can’t handle selecting them all at once, nor 100 at once, I don’t want to resort to going through 10 by 10 until I know there’s no other way of doing this.
Question: Is there an SQL query that can speed this up?
I can’t seem to find where in the database the Shipping Class is kept for each product 🙁
In screen option at top of the page choose to show 1000 products per
page and remove all other fields except title.
Select all products
Bulk Edit
I made this plugin, it loops through all the products of a certain category(s) and assigns the desired shipping class, more details are in the comments:
You can also extract the hook and the callback and add it to your
functions.php
of your child theme, be careful this is a one-time use snippet since it runs every time admin backend initializes.The plugin has been tested with the latest Woocomerce to date 4.x and latest WordPress 5.x as well.