WooCommerce: Assign Free Shipping to a Single Product

Believe it or not, the answer to this very frequent question is inside the WooCommerce settings… so don’t worry too much about coding if you’re not a developer or purchasing yet another premium WooCommerce plugin!

From the WooCommerce shipping rates, you can select “Free Shipping” as a method but that would apply to ALL products – so how do you override the shipping settings and allow a single product to have free shipping, while keeping all the others on a Flat rate?

1. Create a Shipping Class

From the WordPress dashboard, go to WooCommerce > Settings > Shipping > Shipping Classes > Add Shipping Class. Call it “Free Shipping” or whatever you like.

Defining a new shipping class in the WooCommerce settings

2. Assign the new Shipping Class to your Product

Edit the product that requires free shipping by going to Product Data > Shipping > Shipping Class and assigning the “Free Shipping” shipping class to it. Update the product (if you go back to the admin page WooCommerce > Settings > Shipping > Shipping Classes, you should now see a “1” under “Product Count”).

Assigning a shipping class to a WooCommerce product

3. Set up a Flat Rate based on Shipping Class

Go to WooCommerce > Settings > Shipping > Shipping Zones. In each zone you should have at least 1 Flat Rate. Edit each Flat Rate, and make sure:

  • Cost is $0
  • “Free Shipping” (or whatever you called the custom shipping class) class cost is $0
  • “No shipping class” cost is whatever it would be for other products
  • “Charge per class” is enabled
How to set up a Flat Rate to enable per-product shipping

That’s it.

Now if the product is in the cart and you’ve set up things properly, shipping will be free (unless there is a product with no shipping class as well, in which case its rate will trigger instead).

Related content

  • WooCommerce: “You Only Need $$$ to Get Free Shipping!” @ Cart
    This is a very cool snippet that many of you should use to increase your average order value. Ecommerce customers who are near the “free shipping” threshold will try to add more products to the cart in order to qualify for free shipping. It’s pure psychology. Here’s how we show a simple message on the […]
  • WooCommerce: Weight-Based Shipping Methods
    With WooCommerce you get 3 default shipping methods: Flat Rate, Free Shipping, Local Pickup. For each one you can define a cost, however there is no way to set up some “weight” restrictions. So, what if you want to display a rate for orders below 10 kg, and another shipping rate for orders above that […]
  • WooCommerce: Hide Shipping Method If Shipping Class Is In The Cart
    Our goal is to check if a Product with a specific Shipping Class is in the Cart, and consequently disabling a shipping rate such as Free Shipping if this is true. This is super useful when there are multiple items in the cart and you don’t want to give free shipping for certain orders for […]
  • WooCommerce: Hide Shipping Rates if Free Shipping Available
    If Free Shipping is available, you possibly don’t want to show the other premium shipping options. WooCommerce shows by default all shipping rates that match a given shipping zone, so it’s not possible to achieve this from the settings alone. Thankfully, the “woocommerce_package_rates” filter allows us to manipulate the shipping rates before they are returned […]
  • WooCommerce: Hide Shipping If Local Pickup Is Selected
    Let’s talk about checkout UX: if a user is willing to pick up the item in store, why should there be a shipping form on the checkout? Well, let’s see how we can hide this dynamically with a bit of PHP and JS!

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

108 thoughts on “WooCommerce: Assign Free Shipping to a Single Product

  1. Is there an option, hook or plugin where I can choose shipping on the product page instead of going to the cart in Woocommerce, that is, the customer enters their zip code on the product page, and when they return the shipping is available right there on the page of the product, he can choose shipping via a radio input

  2. Hi Rodolfo, in cart there is a product with free shipping and another with paid shipping
    Shipping costs are hidden and only free shipping is available.
    I don’t want it that way, I want the shipping costs to be paid
    how can I do? thank you very much

    1. Hey Matteo, see the note “unless there is a product with no shipping class as well, in which case its rate will trigger instead”. If you create a Flat Rate instead of Free Shipping Rate, this will work the way you want

  3. Does not work πŸ™

  4. Hi Rodolfo, I’ve been trying to set up free shipping with a shipping method of UPS and Spee-Dee, and I’ve followed the steps you outlined. The Flat rate option is below the UPS method, and it seems to be working as expected. The only thing is that the “No shipping class cost” is visible in the other shipping options on the cart and checkout. Do you know of a way to hide this option? Thanks for your help!

    1. Not sure I 100% follow. Screenshots of the settings and frontend shipping calculations please?

  5. Very helpful. Thank You

  6. I tried this several times and for some reason couldnt get it to work

    1. Hello Kay, thanks so much for your comment! I’m afraid this is custom troubleshooting work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  7. Thank you so much for posting this, I have been tearing my hair out and trying multiple plugins to do this, but your solution was perfect!!

      1. Me too. Thank you so much.

  8. Great blog, it has helped so much with our store! Thank you so much for making such great content!

  9. Hello, I have a problem, hopefully you will help. I want to do that: when the customer add two products to cart. One of them has free shipping class and the other one is different. Then it charges the customer shipping price. It shouldn’t be charged. How can I fix it?

    The shipping price must be 0 when a free shipping class product in the cart.
    Thanks.

    1. Hi Murat, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  10. Hi Rodolfo, Thanks for your article! Somehow I cannot get this to work. I have a “flat rate” setup with a specific amount of shipping fee for all my products, as well as a “free shipping” class for when the cart is above a specific amount. Now I want to add a free shipping on some specific products. But I followed your steps and the free shipping simply does not occur on the checkout. It keeps the flat rate amount and charges the standard shipping fee. I tried to make a second free shipping class called “no charge” where I just put zero cost but that also does not seem to work. Can you help me resolve it? I have no clue what I am doing wrong…

    1. Sorry Judith, can’t help with custom troubleshooting here

  11. Hi Rodolfo,

    Many thanks for all your snippets and tutorials – they have been invaluable to me over the last year!

    I’ve used the global code here, and it works great – the shipping charge goes to Zero – However, the name of the rate “Flat Rate” is still diplayed, and there’s no actual zero character displayed – so it might appear to customers that they are getting charged for shipping when they are not. – Is there a way to change the label, to something else (like, “Free Shipping”) in this case?
    Many thanks!

    1. Rename it to “Shipping” maybe? Otherwise, I don’t remember but there may be a snippet on this same site, somewhere

      1. Had the same issue, wrote this snippet to fix it πŸ™‚

        function noknok_studios_modify_package_rates( $rates ) {
            foreach( $rates as &$rate ) {
                // Hotfix for Flat Rate Shipping Label when Flat Rate is $0.00
                if( $rate->get_method_id() == 'flat_rate' && floatval( $rate->get_cost() ) == 0.0 ) {
                    $rate->set_label( __( "Free Shipping", 'woocommerce' ) );
                }
            }
        
            return $rates;
        }
        add_filter( 'woocommerce_package_rates', 'noknok_studios_modify_package_rates', 20);
        
        1. Cool

  12. This is not working for me, I’ve already got a flat rate code for 8.99 which is applied to all of my products but I want to add free shipping to a select few products, however when I set up the new class/zone and I apply the shipping method to the selected product it still comes up with 8.99 shipping. Please help?

    1. Hello Pippa, thanks so much for your comment! If you’d like to get a quote for troubleshooting the issue, feel free to contact me here. Thanks a lot for your understanding!

  13. hi! this is great however i am using table rate shipping. how do i integrate into that?

    1. Hi Jamie, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  14. Hi

    Great article, but how do I remove the ‘costed shipping’ option? See here: https://www.screencast.com/t/1ur1TZiBYUes I do not want the Β£9 to show.

    So it should be Free shipping for a voucher product

  15. Hello Rodolfo,
    I tried your tutorial, it is very well explained. Thank you.
    But in my case, it doesn’t work.
    I created a specific shipping class for free shipping and a dedicated shipping zone.
    I have associated the product with the class and it is ok.
    But … I have other shipping zones with postal codes.
    When I slide the “free shipping” area above the others, all products (including the one with the shipping class) take free shipping. It is then impossible to select the other shipping methods.
    When I slide the “free shipping” zone below the other shipping zones, the free shipping is no longer available.
    Can you help me ?

      1. Cool

  16. Hello, nice tutorial, it helps me a lot!
    I have a question, if i have enabled this Flat rate Free Cost in a product, how to hide ALL of the others shipping methods?
    In my site i will have about 5 different shipping methods and when i get into the cart / checkout, all other shipping methods appears, i need to hide all other shipping methods if im using FLAT Rate in specific products.

    Thanks

  17. Sir can you please help me? How to add the shipping rate for the specific product programatically by adding in functions.php for woo commerce?

    1. Hi Swathy, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  18. Hello,

    I am using Product Vendors. Can every vendor add rules for free shipping and different shipping prices on their own products.

    1. Ask plugin devs please

  19. Hello, how can I have just one way of shipping for the client to see in checkout?
    I don’t want them to see but just one shipping method without being able to choose between two.
    Is this possible?

    Like for certain items I want them to have regular shipment method base on location, and for other items I want them to have a flat rate, but when I have a class for Flat Rate and I have it enable as shipping method it’s showing them at the checkout the option to choose between those two. How can I do that?

    Thank you!

  20. I tried doing this on a subscription and when I go to check out, it is still charging for shipping. The shipping price is included in the overall cost and I would like my customers to be able to check out without having to add a coupon or anything. Nothing seems to be working.

    1. I see, snippet might require customization to work with Subscriptions I guess

      1. Amanda, did you ever find a solution to this? I’m having the same issue and have been searching and experimenting for hours. The “free shipping coupon” method is not ideal but that may be what we end up doing…

  21. Hello! I have two shipping methods for my website: “Flat Rate” and “Free Shipping”. The Free Shipping is based on a minimum order amount. My problem is this… when a customer reaches the minimum amount, the Free Shipping button appears but is unselected and the Flat Rate option is selected by default. So the customer has to select the free shipping. I don’t mind both the Flat Rate and the Free Shipping appearing together at checkout, but I don’t want the Flat Rate being selected by default. How do I make the Free Shipping the default when the minimum amount is reached? Thank you.

    1. Drag/drop Free Shipping rate above Flat Rate in the WooCommerce Shipping Zone settings

  22. Rodolfo, you are awesome. Thanks so much for all the great info. I followed the instructions and it worked!
    Phil

    1. Fantastic!

  23. I see the comment above “Does this work with Variable products? For the life of me i can not get it to take?”

    Your answer said “apply it to all of the products”.

    My products are all priced with a delivery fee.
    The one product (Repair) has no delivery fee as it is a ‘repair’.
    This lets you choose the product via a variable choice selector, and as it is not physical should not have a delivery charge.
    But this always adds a fee?

    What I need is for one product somehow hard code a zero delivery fee? (Depending on the product it changes the repair fee)
    Any ideas?
    One zone UK and one flat fee (Β£9) else free shipping has been added.

    1. You should make that variation “virtual” maybe?

  24. Hello, I would like to set up free shipping only for customers that order 2 or more products. Is this possible?

    Thank you for your help

    1. Hi Alb, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  25. Hi,

    what if I need to set the free shipping over a certain amount, for a specific shipping class only?

    Thank you

    1. Hi Nicholas, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  26. Thanks so much for this info Rodolfo. I was able to get half of what I needed done. I was using a table rate plug in. I added the free shipping class and followed your steps. I wasn’t able to make it work where I could have it free for one product because the shipping class was overriding it I think. I disabled it in Woocommerce setting and the shipping class was able to reflect the free. I think I’ll just adjust all the prices on my products and then say free shipping on all items. What do you think? Or if you have time, can you help me out a bit? Thanks again and I hope you’re staying safe despite the COVID-19 outbreak and having a great week!

    1. Thank you Cheryl! Yes I don’t know how this works with table rate plugins – but wouldn’t that table rate plugin offer you something like this? Otherwise it makes no sense in using it. I can’t help you more than this, but thank you so much anyway

  27. Hey. Any way of adding the free shipping as a discount in the invoice for accountability purposes? We still pay the shipping and can deduct it from taxes but the automatic invoices have 0$ as shipping instead of $10 – $10 Discount.

    1. Hi Adrian, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  28. This was really helpful thanks.

    1. Great!

  29. Hello,

    I have a certain group of products that have the shipping cost built in to them already and other products that do not. For the products with the built-in shipping I had originally left the shipping blank for them and then there was an error when checking out that said no shipping method assigned. So I followed your steps above and did a bulk edit for only the items that needed the flat rate $0 shipping. It has now offered my flat rate method as a shipping option in the cart, but all the other shipping methods are still options. Additionally, and most problematic is that this flat rate method shows up as an option for all my products even if I did not assign it to this shipping class. How can I get the flat rate option to disappear from all my other products?

    1. Hi Tiffany, It’s confusing. Even when I figure it out, 6 months later I try to do shipping for a product again and it wastes my afternoon. I’m certain they could design all this to make it easier to use. If they don’t then we will continue to see popular alternatives continue to grow. Wix, Shopify etc. So many small business owners just can’t be bothered with Woo and I am starting to see why. They need to allow more control for editing shipping on the individual product. It would also be great to show FREE Shipping on the cart instead it changes to flat rate on all products just when you want to change one. If it’s free shipping on that product then we need to make it clear as day for customers. Spell it out in capitals! This problem alone is costing me sales and I’m sure I’m not the only one.

  30. I am confused, it’s not working for me. I am using UPS rate calculator, so what value do I put for No Shipping Class Cost in that case?

    what i have now:
    “free shipping” shipping class cost 0
    “UPS” shipping class cost N/A
    No shipping class cost N/A

    1. Hi Meg, sorry, not sure how this integrates with third-party shipping providers

  31. Is it possible to assign free shipping to specific category?

    1. Yes, via code. Or can you not bulk assign the shipping class to all products belonging to that category?

  32. Hello this works good but how can it show Paid Shipping $ cost if the shipping for product its paid and Free shipping i use name
    Transport when the Transport its paid its Showing Transport $2 when its free its showing Transport without number

    1. Hi Poter, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  33. Hi, I have successfully do what you said in the post, and it works well πŸ™‚
    My issue is that when the conditions are met (there is a product on the cart with the “Free Shipping Class”) on the checkout page, I see:
    Shipping: Flat Rate
    Is there a way to show other than Flat Rate, this is confusing for customers.. (shows flat rate without any cost or number)
    Thank you.

    1. Cool! Maybe you can rename the shipping rate label from the settings?

      1. Hi. Thanks for this. How can a apply free shipping on a product which will affect my country.only
        I want the free shipping to affec t where I live. How can I do that?

        1. Hi Joke, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      2. I have the same question.. it says Flat fee instead of free shipping or 0.00… this is confusing to customers. How do we change this.

        1. Can you rename it into “Shipping” instead of “Flat Fee”?

          1. I have set up everything like you descibe it, but still I have either free shipping on all product or the shipping rate that I have for products with free shipping, seems like the system can tell the different or are capeable to tell which product have free shipping and what not have free shipping
            Very(ectremely) confusing

    2. I have an issue where I want category that I offer free shipping and went to customer by mix category items it does not acknowledge the free shipping for that product or coupons at all cuz I exclude coupons in that category

      1. Hi Thomas, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

    3. I agree, confusing. Change the label to what? Flat rate ( maybe, unless it’s free) click through to the cart for more confusion. Welcome to my shop of products, some with free shipping some without. You’ll never know until you give one a go. Roll up roll up. Spin the wheel for more random woo confusion or continue shopping. Thanks for your business

  34. Thank you for this great solution!

    1. Cool!

  35. Hi, if the item costs $100 and to ship it costs our company $15 – but the customer sees the price as “$115 and Free shipping”.
    How is the shipping calculated/split in the backend given the application of “free shipping”? for tax and costing purposes.

    1. Hey Adam – if you use Free shipping, you will see $0 shipping

      1. If I change the the zones so I will have free shipping in top, then all products have free shipping, but if I move down free shipping one place and have normal shipping fee/rate as the first zone then all product will have this shipping fee/rate, how will you explain this?
        Maybe instead you should have in product under shipping an option to choose shipping method, and NOT the shipping class

  36. I am equally confused the same way as others are when our store already has other shipping methods set up.

    Typically, we run only FedEx shipping method for all products, all zones, all classes. In the past, the only time we offer free shipping is with a discount code. But this time, we wanted to run a sale/promotion to include free shipping for only one product without the need for a code so this solution looked perfect.

    But when this approach is utilized and other products/classes exist in the cart, the Flat Rate shipping method is included with the FedEx shipping method. Then, the shipping options resort to the flat rate table lookup based on each class. But we do not have flat rate options for the other classes (we have FedEx shipping options) In other words, this solution only works if you are able to operate under a flat rate approach for all products/classes, not just the one you want to offer free shipping for. Is that correct?

    1. Yes Blake, this works out of the box if there is only one product in the Cart. For more complex scenarios, there’s always custom PHP that can give you solutions, but I’m afraid this is custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  37. What about if I’m looking to make product A’s shipping free but charge shipping for product B using USPS’s API. So for example if both products A and B are in the cart, the only shipping that would be calculated is for product B. Product A’s shipping cost is simply not calculated by USPS’s API. Is this possible? And if so how? I keep finding that when I label product A as free shipping, and have both product A and B in the cart that it simply gives me a free shipping option for the entire order or a calculated shipping cost from USPS’s API that factors in both products.

    Let me know if this is clear or if I can clarify any details.

    Thanks!

    1. Hi Kyle, please ask USPS plugin support

  38. hi,
    I have free shipping products and paid shipping products in my website. paid shipping products are configured as per weight based shipping as am selling some heavy items. So i need the following scenarios to be configured.
    1. Free shipping method should be applied when only free shipping products available in cart,
    2. Weight based shipping method should be applied when a customer add any other products along with free shipping products.

    Hope my idea is clear to you. Any help would be apreicated

    1. Hello Vahid, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  39. Is there an option to offer free shipping for the entire order IF the order contains ANY product with the free shipping class? As soon as my customer adds a product from another class shipping gets added to their order. If our customer orders from class x then products in class y should also be shipped free of charge despite being under the usual threshold for free delivery.

    1. Hiya Mariella, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  40. Hello,
    I don’t get the point. If I set up the flat rate to 0€ the other products also won’t have shipping costs..
    Am I missing something?

    Thank you

    1. The other products have no shipping class, so they will be priced differently as long as you follow this tutorial πŸ™‚

  41. Hi, one question: what if β€œNo shipping class” cost can not be one price but depends on shipping method?

    1. Hi Marek, thanks so much for your comment! Yes, this is possible – unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  42. Hi, I tried this method and I still can’t figure out what I am doing wrong. I noticed that it now shows up the customer can choose this free shipping option along with the other shipping cost options no matter what products are in the cart. not just the dedicated one

  43. Hi. The shipping class is still showing as an option even when I do not have the item in the cart. I can’t figure out what I am doing wrong.

    1. Hey Taylor, thanks for your comment! Did you follow the instructions @ point #3?

  44. Does this work with Variable products? For the life of me i can not get it to take?

    1. Of course Ryan, just apply the free shipping class to each single variation πŸ™‚

  45. After hours of googling and trying everything under the sun to get this to work, including a free plugin that I found out later only gave free shipping to ALL the products in the cart ;p yours worked on the first go round! Not only did it work for free shipping on my charity item and not the other items, but it didn’t automatically add shipping to every item in the cart (instead of just the cart of items). Thank you! book marked in case I ever have to do this again.

    1. Awesome πŸ™‚

  46. Hi

    I am using the Table Rates Shipping plugin. Can I use this to designate one product for free shipping?
    I am trying to complete the setup of my store as I open in a few days and am panicking a bit.

    WooCommerce support has been great but this is a detail I’m having trouble with.

    I will really appreciate your help here.

    1. Hello Marilyh, if you use that plugin you won’t need this snippet, you can achieve that from its settings πŸ™‚

Leave a Reply

Your email address will not be published. Required fields are marked *