Removing shipping for one product with coupon

Instead of remove shipping, you can apply Free shipping for specific products. You even don’t need any code for this.

Using the free shipping method will not allow you to specify certain products since it does not have the options to accomplish that such as shipping classes. Instead, we are going to use the Flat Rate shipping method.

  1. Go to the shipping zone, and add the Flat Rate shipping zone to it.
  2. Then, go to WooCommerce ⇒ Settings ⇒ Shipping ⇒ Shipping Classes, and create a new class and name it ‘Free Shipping‘.
  3. After that, go to the Products page, and select from the table the products you want to set them as free shipping, select the checkboxes, then at the top of the table select Edit from the Bulk Actions, then click apply.
  4. Set the shipping class of the products to ‘Free Shipping’.
  5. Now, go to Shipping Zones and click on the ‘Flat Rate’ method. You’ll be redirected to the method’s settings page.
  6. Change the name of the method to ‘Free Shipping’.
  7. Finally, set the “Free Shipping” Shipping Class Cost option to 0.
  8. Save the changes and now only the products that have the ‘Free Shipping‘ class will have a free shipping.

Credit: https://wpruby.com/woocommerce-set-free-shipping-certain-products/