WooCommerce: Add Text Under Each Product @ Shop Page

A client asked me to add a “Free Shipping” notice under each WooCommerce product on the Shop Page. This can increase your click-through rate and hence your sales conversion rate. Here are a couple of PHP and CSS snippets so that you can implement this helpful edit.

WooCommerce: Display a Custom Product Text Badge @ Shop Page

PHP snippet: show “Free Shipping” under each product @ WooCommerce Shop

 * @snippet       Display "Free Shipping" under each product @ WooCommerce Shop
 * @how-to        Get CustomizeWoo.com FREE
 * @source        https://businessbloomer.com/?p=330
 * @author        Rodolfo Melogli
 * @compatible    Woo 3.5.1
 * @donate $9     https://businessbloomer.com/bloomer-armada/

add_action( 'woocommerce_after_shop_loop_item', 'bbloomer_show_free_shipping_loop', 5 );

function bbloomer_show_free_shipping_loop() {
	echo '<p class="shop-badge">Free Shipping</p>';

“I don’t code – is there a reliable plugin for that?”

As many readers would love to code but don’t feel 100% confident with it, I decided to look for a reliable plugin that achieves the same (or even better) result.

In this case, I recommend the YITH WooCommerce Badge Management plugin. On top of displaying custom text badges (free version), you can also create CSS, image and advanced badges, assign product badges to specific products and/or categories, pick the badge position and much more.

But in case you wish to code, keep reading 🙂

Where to add custom code?

You should place PHP snippets at the bottom of your child theme functions.php file and CSS at the bottom of its style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my guide "Should I Add Custom Code Via WP Editor, FTP or Code Snippets?" and my video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything went as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting.

If you think this code saved you time & money, feel free to join 17,000+ WooCommerce Weekly subscribers for blog post updates and 250+ Business Bloomer supporters for 365 days of WooCommerce benefits. Thank you in advance!

Need Help with WooCommerce?

Check out these free video tutorials. You can learn how to customize WooCommerce without unnecessary plugins, how to properly configure the WooCommerce plugin settings and even how to master WooCommerce troubleshooting in case of a bug!

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.

59 thoughts on “WooCommerce: Add Text Under Each Product @ Shop Page

  1. Hi,
    I have question, I would like to ask if it is possible to pass custom value to a hook ? I have plugin where I manipulate with price and after I get result I would like to write a text under variations not directly under price.

    As I found on you website site I could use hook name: woocommerce_after_shop_loop_item

    I didn’t found an option to call a hook and pass custom text is that possbile ?

    Thank you in advance.

    1. Hi Aljaz, 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. Yeah this applies to all products, but a reasonable thing to mention would be a conditional if this only should apply to products that actually have a free shipping class.

    function bbloomer_show_free_shipping_loop() {
    	global $product;
    	$product_shipping_class = $product->get_shipping_class();
       if ( $product_shipping_class === 'free-shipping') { // Goto shipping classes and check the slug and enter it here
       	echo '<p class="shop-badge">Free Shipping</p>';
    1. Thanks for your solution Yoyo!

  3. Hi, i was wondering if its also possible to add a custom text ( “Coming soon” ) ,to the products from a specific category, below the price on the shop/archive pages? Hope to hear!

    1. Hi Jasper, 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!

  4. Can I use the same thing, If i would like to add text on the default shop page at the bottom after all products?

  5. Hi,
    Is it possible to add text to only the “SALE” products?
    Tried this but it’s for all products.
    Please guide.
    Thank you!

    1. Hello Zeian, 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!

  6. Thank you for all your Woocommerce customization articles – you are a lifesaver! Thank you thank you!!

    1. Welcome!

  7. What about if I wanna ad costom text on specific products only.

  8. Dear…I am using woo commerce and I want to remove category labelled before (woocommerce_before_shop_loop_item_title) on the product page. I used many snippets but neither works…Hope, you have the answer for the same. Thanks in advance…and always loved your PHP snippets that helped me a lot…

    1. Hi Asif, 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!

  9. Hi there!
    Amazing post! For readers who want to show ‘Free shipping’ on some products, but weren’t able to pull it off using conditional logic, I found “Product Subtitle” plugin to be quite useful.
    Customizing the plugin with some tips from here https://businessbloomer.com/woocommerce-add-icon-add-cart-buttons/ gave an amazing result. (It was a bit tricky, but trust me, anyone can find their way around it.)
    Thanks alot Rodolfo,

    1. Great!

  10. I really appreciate your good article! But how about changing ‘Free shipping’ to ‘read more’, and connect it to product page when clicking it?

    1. Hey there, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

  11. Hi,

    Can you help me with right snippet for showing “free shipping” text on category pages but for specific products only? Thanks

    1. Hi Krecko – thanks so much for your comment! I suggest you take a look at “conditional logic”: https://businessbloomer.com/conditional-logic-woocommerce-tutorial/ and https://businessbloomer.com/woocommerce-conditional-logic-ultimate-php-guide/. Let me know 🙂

  12. Hi, how do I go about changing the alignment? Right now it sits on the left hand bottom corner but I need it to be centered. Thanks!

    1. Hey Farah, thanks for your comment! You’ll need a bit of CSS for that 🙂

  13. Hi, Rodolfo!

    Thanks for your snippets, it’s very usefull.

    I want to add text only for variable products. How can I change this snippet for my issue?

    1. I try to do this:

      function show_free_shipping () {
      if( $product-&gt;is_type( 'simple' ) ){
      echo 'Free Shipping';
      add_action('woocommerce_after_shop_loop_item','single_product_type', 20);

      But its wrong 🙁

      1. Function name does not match 🙂

        1. Hello,

          I want this too, what is the correct code then?

          1. Hi Tuutje the whole code is correct, just the function name must match inside the hook trigger and the function declaration

  14. Hi Rodolfo,
    I’m one of your fans in terms of how you neatly work on woocommerce. You’ve mastered the art of how to make things sound and look easy. Recently, I’ve also learned about creating widgets. I think setting up widgets for these customizations will be of great value. I just thought, I might be able to help in return with this. Because if a widget is setup, choosing specific products and editing will be a lot comvenient and safe. It will also save woocommerce users a lot of time, like 20x more. 🙂

    1. Thanks for that Henry 🙂

  15. Hi there,

    Excellent resource!

    I have used you snippet but I want to integrate it with the a Custom field plugin

    I have a custom field “forfatter_key” that is retrieved with: wccf_print_product_prop_value()

    How is that integrated into your snippet?

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

  16. Possible to show the free shipping only if the product price is above the shipping threshold?

    like free delivery for product above $20?


  17. Is it possible to have the text after the price but keep it in the loop item? I need the text to also link to the item page, thanks

    1. Hey Pete, thanks for your comment! Yes, of course, you just need to change “hook”. I recommend studying this guide: https://businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/

  18. I want to print message free shipping in my shop page in condition wise like if mobile category so print free shipping other category then i don’t want to print free shipping and print this is not free shipping like…

    1. Hey Meet, thanks for your comment! This resource should help: https://businessbloomer.com/woocommerce-conditional-logic-ultimate-php-guide/. Let me know

  19. I just found your website on a random search.. Thanks for sharing your knowledge… I am using the php snippet to show per carton text underneath each product on the home page of a site… It works like a charm!!

    Now my client has added a new product..
    And for that individual product they need to have the “per carton” text removed..the product category is “soy-wax-candles”.. I tried excluding the new product by product id without any luck..

    I am new to php, but willing to learn.. Just need a nudge on the right direction..

    Any help that you can offer would be great!

    Signed-up for you news letter!

    1. Mike thank you so much for the feedback – much appreciated! Can you let me know what you did when you “tried excluding the new product by product id without any luck”? That would possibly help me help you 🙂

  20. Thanks for illustrating use of the hook but don’t use id=”loopfree” in the loop as it will create multiple instances of the same id.

    1. Hey Bobster thanks a million for your very helpful comment! I just updated the snippet and changed that from id to class. Much appreciated 🙂

  21. Hello 🙂

    You can have the message call for price on the store page in products where the price is empty ?

    1. Hey Hugo thanks for your comment! Yes, this is custom but you can check if price is empty and return a custom message 🙂

  22. Hello,
    is it possible to add an additional line just after(below) the product title on the category pages? So not underneath the price but between product title and price? I know how to add the product_excerpt there, but I don’t want the product excerpt, just one small additional line. Thanks!

    1. Hello Andrea, thanks for your message! Of course it is possible. I used “woocommerce_after_shop_loop_item” hook, but there are more hooks you cna use to target the exact position you wish to place your text. Try using “woocommerce_after_shop_loop_item_title” 🙂

  23. Hi,

    Many thanks for these high quality yet simple code snippets for woocommerce. i want to put KG/peace after the “quantity box”. is that possible, if yes then how?

    Thanks in advance

    1. Thanks for the feedback! To add the weight, try this:

      if ( $product->has_weight() ) {
          echo $product->get_weight();
  24. is possible this? only show the message (free shipping) if the amount is more than certain price ? (sorry my english)

    1. Hello Martin, thanks for your reply – check this article: https://businessbloomer.com/woocommerce-add-need-spend-x-get-free-shipping-cart-page – it works in a similar way than the one you’re asking. Hope this helps!

  25. Thank you for this code. Is it possible to add a custom message under a specific product. Some of my products will have freight cost sice they are heavy.

    1. Johannes, thank you for your enquiry! Yes, of course, it is possible to do absolutely everything 🙂

      You will need some more advanced PHP that controls if the product weight is above “XYZ”, and only then prints the extra message.

      It’s a bit advanced. You can check the product weight with this: $weight = woocommerce_get_product_terms($product->id, ‘pa_weight’, ‘names’)

      Hope this helps!

  26. Hi,

    FYI, I never received you follow-up comments notification email (3 posts).

    I had made it worked in parent category. Need you light here.
    1. I had 41 subcategory (incl. 1 parent category – Books) how is the conditional tags like? have to key-in all “slug”? Any conditional tag 1parent category apply to all subcategory?
    2. I google-ing the conditional tag for apply all “product” to “shop page” and category (& subcategory) for specific category (with the answer point 1.0). Any guide?

    Thousand Thanks

    1. The conditional tag is_product_category(‘slug’) works with main and sub categories no problem. In case you have multiple categories to target, you can use is_product_category( array( ‘slug1’, ‘slug2’ ))

      Hope this helps!

  27. Useful resources. Same question I asked before, Can I use WC conditional tag to wrap your snippets for specific product category, especially root-category (included all subcategory).

    Almost complete read all your WooCommerce Tips. Genius!

    Subscribed your newsletters.

    Thanks in advance

    1. Of course! When you trigger the function, you can use something like this:

      if ( is_product_category( ‘shirts’ ) )

Questions? Feedback? Support? Leave your Comment Now!

If you are writing code, please wrap it between shortcodes: [php]code_here[/php]. Failure to complying with this (as well as going off topic, not writing in English, etc.) will result in comment deletion. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining BloomerArmada to get blog comment reply priority, ask me 1-to-1 WooCommerce questions and enjoy many more perks. Thank you :)

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