Ask SkyVerge

A common WooCommerce question lately has been how to hide the “Free” price label in the product/category/shop pages. Thanks to WooCommerce’s judicious use of filters/actions, this is very easy request, yet if you’re new to WordPress/WooCommerce you might not necessarily know exactly where to look. Well look no further, because here’s an easy way to suppress that “Free” notice for regular/variable products:

add_filter( 'woocommerce_variable_free_price_html',  'hide_free_price_notice' );
add_filter( 'woocommerce_free_price_html',           'hide_free_price_notice' );
add_filter( 'woocommerce_variation_free_price_html', 'hide_free_price_notice' );

/**
 * Hides the 'Free!' price notice
 */
function hide_free_price_notice( $price ) {

  return '';
}

Simply add the above to your theme’s functions.php in the usual manner (theme-name/functions.php), or perhaps to your custom site plugin and you should be “Free” price label free!

Published by Nik McLaughlin

You can find Nik around the WP space, on LinkedIn, or on his personal blog.

124 Comments

  1. Thankyou so much!!

  2. Can we get rid of those red price labels?

    • You’re talking the red price labels that the Wootique theme uses? That’s just how Wootique styles the “price” span. So other themes aren’t necessarily going to use that red label. If you want to change how Wootique styles prices on the catalog page, you’d want to do it with some CSS styling in your custom.css for instance. To get rid of the pricing on the catalog entirely you have a couple of different options, including some filters or overriding the price template. Hope this helps to give you an idea

  3. I have Virtual Downloadable products, That are Premium and Free. How to skip the Payment/Cart page for Free Products ? I need Direct download from product detail page if the product is free. For premium products, There will be cart and payment page.

    So how can i do with Woocommerce ??

    • Hey Surjith, that’s a great question. Actually, I don’t think there’s any way to skip the payment/cart page for free products yet with WooCommerce. At least, not while still having an Order record created and whatnot. I suppose maybe you could do something along the lines of creating a product and just including a link to the file to download, it really all depends on what you’re trying to achieve, and how you want it to behave.

  4. What about just changing the text from “Free” to “Price Not Announced” or something similar.

  5. I ended up changing “Free!” in “class-wc-product.php” (found here: /wp-content/plugins/woocommerce/classes)

    and made the product an external product with no link out.

    I’m guessing this will be overwritten when I upgrade woocommerce though.

  6. Nope that didnt work, get too many errors in the WP admin area….boooo!

  7. Working great. Thanks so much!

    • Sweet! You’re welcome!

      • Hi!,

        Can you please tell me how to keep a or certain products “FREE” of charge in woocommerce…i.e. product that is free of charge, on adding to cart the price will not be calculated but that product will be included or treated as purchased item..

        Pls help…

        Thanks in advance..

  8. not work with my template.

  9. Thanks for this great info. I have all my items with a zero sell amt. I’m using the cart as a ‘request for quote’ tool.

    Can you help with the filters to use to remove the prices from the cart and checkout pages?

  10. I’d like to hide all pricing but still have the cart. I’m using the cart as a wish list to quote.

    I found a list of WooCommerce actions and filters

    http://wcdocs.woocommerce.com/codex/extending/hooks/

    I figure I can add a filter for every reference that has ‘price’ in the title.

    What I don’t know to add is for the variable portion of the filter. Your example has “10, 2”.

    Where can I find the variable info for a filter name? Thanks.

    • Hey Brad, you may have already figured this out, but the first argument there, ie 10, is the priority of the function added to the action or filter, and the second parameter, ie 2 is the number of arguments that the action or filter passes. Unless you need your function called before or after another one which is hooked into the same action/filter, just use 10 for the priority. For the number of arguments you have to look at the particular do_action() or apply_filters() call, or the documentation for the action; this defaults to 1. Check out the add_action() reference on WordPress.org for more info. Hope this helps!

      • Have you made any progress with the priceless store with cart? I’m very interested in this possibility. Suggested plugin name “priceless” 😉

        • Hey Jeremy, this is at the top of our list to tackle in the next few months 🙂

  11. Hey, great help with the above snippets!

    On a similar note, I was wondering if you could tell me how to change a price that was set to $0 to display “Call For Price”?

    Some of my products are high priced and we sell them better on the phone 🙂

    Any help would be great!

    • Hey Joe, in that example I show above, instead of return ''; try replacing that with the text you want; ie return "Call for Price";

      • Those products could then still be added to the cart right? So basically the products would still be for sale and cost nothing.

        Is it possible to make the product ‘Call for Price’ and deactivate the ‘Add to cart’ function, but still have all the variations active and showing the drop downs?

        • Yup, you should be able to do this by tweaking the product/catalog page templates

          • I have some products that work just fine with the simple product WooCommerce feature, but others that are customized and I just want to get rid of the price and cart feature if possible. Want customers to just be directed to email us. Not have the option of going through the cart for no reason. How would I do this?

          • Hey Garry, give the Catalog Visibility Options extension a try.

  12. Hey Justin

    What if I want to change the “free” price label back to the original price / sale price? How to do that? Thanks..

    • Well, a non-free price will still display as normal, so there’s nothing really that you need to do

      • Actually I’m having an issue using Hustle theme. I used your snippet of code and the FREE label is gone. But now the Regular Price / Sale Price does not show up in the Featured Products Widget on the homepage of the theme. It’s just an empty area where the Price should display. Never had this problem before.

    • Hey Max, do you know if that extensions works for variable products?

  13. Hi Justin,

    i want the whole order proces but whitout prices. So everything needs to be not showed or left out of the proces. Someone orders and they will be billed and priced offline.

    Can you help me out? I created a page and left it out of the productspage but the cart and checkout page is more difficult. I do understand I need hooks but wich ones?

    Hopefully you can help soon

  14. Justin, Do you have a hook to remove it manually until it can with a plugin? Or don’t you have any code so far?

  15. thx! very helpful

  16. Thank you! Just what I needed 🙂

  17. Hi,

    Adding this code to my child-themes functions.php affects the FREE! label on the ‘From:Price’ but not the actual price when customer selects the product that costs zero.
    I see that editing class-wc-product-variation.php on line 246 will take care of it, but I can’t figure out where to place the edited version it in my child-theme. I’ve tried every path I can think of.
    Ideas?
    Thanks!

    • Hey T.J, there’s a couple of filters there that you can use to change the price label when the customer selects the product. Try adding them to your child theme’s functions.php and see which one you need to change the price label to what you want. My guess would be the ‘woocommerce_variation_free_price_html’ filter.

  18. Hi Justin,

    This code removes the ‘FREE!’ tag from everything except the final price of a variance product. Any ideas?

    Thanks!

    • Hey Tom, I updated the article to also hide the selected product price label, enjoy 🙂

  19. Hello guys , i have a problem with woocommerce , i think. The price on product page appear fine, but on front page , home page etc , appear ” FREE! ” , how can i solve this. 10x.

    Please help me.

  20. didnt work for me, is there an alternate option?

  21. Hi Justin

    Thanks for the above tip on hiding free

    I have 2 products I want to show with no price with a note in description to apply for pricing. But when I leave the price field blank the ‘Sale’ banner is showing. Any thoughts on how I can stop the sale banner from appearing?

    • This should be fixed in the latest version of WooCommerce. Are you running 2.0.10?

  22. This broke my site. I’m still learning PHP, and may have placed it in the wrong spot. I placed it before the closing PHP tags in my functions file. Suggestions?

  23. This is a popular thread, but any pointers on the errors I get?
    I have a child theme, and functions.php in the root of the child theme.
    When I place the code from above I get the following errors. This is the only code that’s in functions.php. I don’t really want to go down the custom plugin or anything. I’ve tried to remove any additional spaces etc.

    Output before page renders :
    add_filter( ‘woocommerce_variable_free_price_html’, ‘hide_free_price_notice’, 10, 2 ); add_filter( ‘woocommerce_free_price_html’,’hide_free_price_notice’, 10, 2 ); /*** Hides the ‘Free!’ price notice ***/ function hide_free_price_notice( $price, $product ) { return ‘Call for Price’; }
    Warning: Cannot modify header information – headers already sent by (output started at /home/darrencr/public_html/para/wp-content/themes/superstorechild/functions.php:9) in /home/darrencr/public_html/para/wp-content/plugins/woocommerce/classes/class-wc-session-handler.php on line 63

    Warning: Cannot modify header information – headers already sent by (output started at /home/darrencr/public_html/para/wp-content/themes/superstorechild/functions.php:9) in /home/darrencr/public_html/para/wp-content/plugins/woocommerce/woocommerce-functions.php on line 1381

    Note: the price still displays Free! in the product page.
    You’re a star if you give me pointers… It looks like it thinks the code is duplicated or something (I’m no PHP developer). I did try a custom plugin from codecanyon for this but it didn’t work. 🙁
    Cheers
    Darren
    PS : Maybe you should sell your version as a custom plugin 😉

    • Hey Darren, unfortunately this code no longer works due to some changes in WC 2.0 and I see no way of making it compatible again unfortunately. It’s too bad as a lot of people seemed to use this functionality

  24. Worked like a charm – thanks! WooCommerce does have judicious use of filters. Nice word.

  25. I found someone who got this working with 2.0 and seems to work except it dosnt do it with the thumbnail views, like the “related products” and “latest products” views. Anyone know what to add to this?

    add_filter(‘woocommerce_free_price_html’, ‘changeFreePriceNotice’, 10, 2);

    function changeFreePriceNotice($price, $product) {
    return ‘Call For Price’;
    }

  26. This worked beautifully! Thanks!

  27. Good day,
    I have the following problem. I run a shop under WordPress with WooCommerce 2.0.13.
    I do not want the prices to be displayed from the start. If the “price” is not filled in by me, I get the message “FREE”. I want to avoid this message. I want that the field remains “empty” not even zero, nothing.. only empty. How do I do that?
    I use an additional plugin that allows the customer to enter his own price.
    best regards to the experts
    Carsten

    • You should be able to do this by copying and pasting the above example code from the article into the bottom of your theme’s functions.php, ie wp-content/themes/yourtheme/functions.php

      • thank you Justin, that was working fine for me …you are great! But how i can hide the button “add to card” when i don’t show price? give it some code i can put in function.php ….like if price is empty or “0” don’t show add to card?
        kindly
        Carsten

        • one more time, for better understanding… i use a plugin that calls “offer your price” and i don’t want the people see the “price” and the”add to card” button for some of my products.
          but if i have no price at all in Back-end of shop-page then i don’t cant use the plugin”offer your price”.
          kindly

  28. HI there, do you know where I could hook into to remove the text for International Shipping in the checkout page? I set it to 0 and now it says (FREE) but I don’t want that because I would like it read (Shipping Billed Later) instead. Would this be the same principle as what you’re doing above? Thanks so much!!

    • I really need this as well – ever found a solution?

    • i have some product with price and some for quote only i.e. price on request.

      can you help me to put some code in functions.php so that i can get “Request Quote / Enquire” in place of “Add to Cart” in product price = 0

      thanks
      abhay
      [email protected]

  29. hi there,

    im trying to change the ”from” text on woocommerce (wordpress)…i would like to change ”from” for price or pvp… i tryed to change it on language .po… but it didnt work… can anyone help me please?

    Thank YOU

  30. I need your help to made my woocommerce store to a “Request” site, customer can add products in a “Quotebag” fill in all contact details and “send for request” I don´t what to show prices at all.

    I not a PHP guy so please let me know to make this happened on my site.

    Thanks
    Andreas

  31. Perfect, exactly what I needed. Thanks for posting this.

    Dave LeBlanc

  32. Hello, I’m implementing the site http://www.cuccurullocontract.it/Shop/prodotto/pavimento-standard-plus-a-piastre-2/ rather than the price I would like to display add to cart and then eventually the system should send a request a quote. Do you know tell me a plugin that I do this?

    • Hi Luigi,
      Unfortunately there is no extension that does exactly what you’re looking for. You can try this: http://www.woocommerce.com/products/catalog-visibility-options/ , which is close to what you want; it turns your site into a catalog instead of a store, and you can have customers call for a quote. If that won’t work, we’d suggest making products free, with the instruction to go through the checkout process for a quote on the cart’s contents, and that the contact information in the checkout will be used to contact the customer for the quote. Clear instructions could probably make this an easy, viable fix. Hopefully that works for you!

  33. Thank You… Its working great…exactly what I needed…

  34. Buongiorno, sto implementando il sito http://www.cuccurullocontract.it/Shop/prodotto/pavimento-standard-plus-a-piastre-2/ anziché il prezzo vorrei far visualizzare aggiungi al carrello e poi alla fine il sistema dovrebbe spedire una richiesta di preventivo. Sapete indicarmi un plugin che faccio questo?

  35. This looks great thanks.

    I want to disable/hide quantity selector if price==0, for grouped products. How can I achieve that? I’m new to Woocommerce.

    Thanks
    Stoan

    • Hey Stoan, thanks for the question, it’s actually a trickier one than I thought at first blush; allow me to explain. My first idea was to simply configure the $0 child product as “Sold Individually” (which is done by editing the product then within the Product Data panel > Inventory tab: check the box next to “Sold Individually”). I assumed making this change would remove the quantity selector for the child product on the grouped product page, but interestingly it does not. And although the quantity selector remains, and you can increment it past ‘1’, only a single product will be added to the cart, which is good news. It looks like the way the grouped products work is all-or-nothing for the quantity selectors, so if even one product under a grouping is sold in quantity, then quantity selectors will be shown for *all* grouped products. Which is honestly kind of strange behavior. You can make this work in a more sensible manner, but it requires overriding the single-product/add-to-cart/grouped.php template file. As described in the How to Override WooCommerce Template Files article, you’d need to copy woocommerce/templates/single-product/add-to-cart/grouped.php to your-theme/woocommerce/single-product/add-to-cart/grouped.php and modify it by adding the following code:


      <?php elseif ( $child_product['product']->is_sold_individually() && $quantites_required ) : ?>

      <input type="hidden" name="quantity[<?php echo $child_product['product']->id; ?>]" value="1" />

      Right at this line: https://github.com/woothemes/woocommerce/blob/a478246fa092adf7651a78ade4e540f02bec9628/templates/single-product/add-to-cart/grouped.php#L42

      Doing this will serve to hide the quantity selector for any “sold individually” products and automatically add one to the cart.

      Thanks for an interesting question!

  36. Hi there,

    thanks for your helpful adivice.
    I also want to get rid of the FREE notice in related products, but unfortunately the filters don’t work for me. Also the filter mentioned above by Smittyhead only gives an error for the whole shop 😉

    Background: I want to create a site that looks like a shop, but the site owner only sells to distributors. Thus there should be shown no prices at all.

    I use the koorsi-theme on wordpress 3.7.1 with German language extension – maybe this has something to do with it…
    Unfortunately I can’t provide a link, as the site still is in maintenance mode.

    Any idea what to do?
    Thanks a lot in advance! connie

  37. Hi!
    I just found out it is indeed related to the koorsi theme. I changed the code in the theme file – anyway my changes will be lost with the next update… thanks anyway and best regards, connie

  38. Works great, thanks!

  39. Thanks Justin – worked instantly.

  40. is help for me maybe someone need it:

    $price = get_post_meta( get_the_ID(), ‘_regular_price’, true);

    Sale price, is just a different meta key. I think it is:

    $sale = get_post_meta( get_the_ID(), ‘_sale_price’, true);

    just replace code form, include/entry.php and archive-product.php etc …

  41. I am trying to add the “From: min price” back into woocommerce since it is now showing the min-max prices after their recent changes. I’ve looked everywhere but everyone seems to want to go the opposite way!!! Any ideas for this please?

    Many thanks!

  42. I need to remove the

    “(Free)” Label from the Flat Rate Shipping with out a price or with a price of zero. I need it to say

    “will be calculated”

    please help.

  43. The easiest way to do this is with css:

    .woocommerce span.free {
    display:none;
    }

    BAM DONE!

    • Wow, the PHP code is not working on my website, but your CSS code worked.
      Joseph Kibler Thank you very much!

  44. Thanks. This worked perfectly.

  45. Thank you so much dear

  46. Hmmm….this solution no longer seems to work!

  47. For WooCommerce 2.1.8 I opened wc-cart-functions.php
    I changed:
    $label .= (‘ . __( ‘Free’, ‘woocommerce’ ) . ‘)’;

    to
    $label .= “”;

    This will hide Free label when you make an order.

  48. Thank you Skyverge!

  49. Hello,

    How can I set the shipping to 0 but have the cart not show the “(Free)” text? I already have it saying “Shipping will be determined after checkout”.

    Thanks for your help with this.

    • Hey Beth,

      You could add something like this to the bottom of your theme’s functions.php:

      //Remove (Free) label on cart page for "Shipping and Handling" if cost is $0
      function sv_change_cart_shipping_free_label( $free_label ) {
      	$free_label =  str_replace( "(Free)", " ", $free_label );
      	return $free_label;
      }
      add_filter( 'woocommerce_cart_shipping_method_full_label' , 'sv_change_cart_shipping_free_label' );
      

      This will remove the (Free). You can replace it with anything you’d like by filling in the second set of quotes in this bit: "(Free)", " ", $free_label.

  50. Hi all,

    when using a product variation with the same regular/sale prices, the sticky label “Sale!” is displayed on product image when it shouldn’t.

    http://www.emr-guardian.com/solutions/clothing-accessories/belly-band/

    In fact, as you can see, I have a product with two colors variation and for each, the same regular/sale price.

    Is clearly not a promotion in this case but label is displayed the same (!?)

    This works nicely with single products:

    same regular/sale price => sticky label off

    different regular/sale price => sticky label on

    So, I would like to achieve the same as for single product and have the same behavior when almost one of the variation have different regular/sale prices.

    Thank you for your help.
    LS

    • Hey there, you can remove the sale prices, as they are not needed. Only use regular prices for each variation as well as the parent product and this won’t be displayed. You may want to change the product type to “simple” to make sure you don’t have a sale price set.

  51. Very helpful!!! Thanks!!

  52. It’s possible to write “call us” if the discount price is 0?

    Or

    It’ s possible to create a checkbox and if it’s selected in the price field it will write “call us”?

    Thank you

  53. I have my product pages set to “Simple Product” with a $0 price, and then use the “Add-On” check boxes for customers to select the products they want from the page. The check boxes display both the item name and the price, which is perfect, I just don’t want the automatic price listed as “Free!” since the simple product cost is $0.

    I’ve tried the above filters, but “Free!” still displays as the price on the listings. Could this be because I’m using a “Simple Product” instead of “Variable Product”? Any suggestions? I know next to nothing about coding, so I really appreciate your help!

    • Hey Steph, this works for simple products as well, so that’s not the issue. I’m guessing your theme is maybe overriding the shop template or adding the price in via its own filter, as I can remove the “Free” notice for both simple and variable products in my test shop, I’m afraid you’d need to dig into your theme or ask your theme developer how the price is being added in this template.

      • Thanks for your reply, Beka! I’ll have to do a little more searching and see if I can find a solution that works for our theme. Thanks for taking a look!

  54. I would like my customers to be able to add unpriced products to the cart…that is in turn emailed to me for custom pricing.

    WordPress (latest vers.
    WooCommerce (latest vers.)
    Headlines Theme

  55. Hello, this is really very good , but in compare “Sales ” products it still showing FREE.
    How can show hide that FREE also?

  56. Hello.

    I’m making a website for a fashion clothes selling. I want to do exactly the thing you are shown in your blog article, but i’m using child theme cause i have made some changes to some files. Will this work for me and will this make any changes?

  57. Hey Beka,

    You helped Beth out before on the (Free) text on Shipping and I just wanted to let you know that you are a gem!! that worked perfect for me!

    Thanks for your help here!

  58. is there any way to show badge in every products including bookable products?

  59. I’ve seem to run into a problem with getting rid of the “Free !” display on Composite products, and I can’t seem to find the template that will allow me to change this. I have used the function to replace “free price” with ”, and it works absolutely fine on simple products, but it does not affect the composite product’s individual items. Ideas?

    • Hey David, I’m not too familiar with Composite Products, so I’d recommend submitting a ticket for this to see how the label can be changed.

    • Hi David….I think I just posted the same question. Did you find a solution to this?

      Cheers,

      Chris

  60. How to show text if price not set and if price set then dont show text.

    I wanna type “Price not set yet”, and when it set , it says instead “50 $”

  61. hi! how do I make it so instead of hiding “Free” for a variable product it says “Call for Quote” instead? I found a snippet to add in for a simple product but the variable ones doesn’t work with that.

  62. Hi, thanks for that! I have changed mine to say book Now. Just wondering if you know how to make that linked so when book Now is clicked it will go through to the product page? Thanks.

  63. Hi
    I used the code snippet to remove the “Free” Price.
    I would like to add a link to the ” Call for a Quote”
    How do I do this?

Hmm, looks like this article is quite old! Its content may be outdated, so comments are now closed.