Blog

Hide WooCommerce "Free" Price Label

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!

[affiliate_disclaimer]

87 Comments

  • Safeer 3 months ago Reply

    Thankyou so much!!

    • justin 3 months ago Reply

      You’re very welcome :)

  • Nichole 3 months ago Reply

    Can we get rid of those red price labels?

    • justin 3 months ago Reply

      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

  • Surjith 2 months ago Reply

    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 ??

    • justin 2 months ago Reply

      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.

      • Surjith 2 months ago Reply

        That would be better if they added it as a New Feature.

  • Dwayne 2 months ago Reply

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

  • Dwayne 2 months ago Reply

    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.

    • justin 2 months ago Reply

      Hey for this, just add the above two filters that I mention, and for the function use:

      function hide_free_price_notice( $price, $product ) { return 'Price Not Announced'; }

      • Marius 2 months ago Reply

        Worked for me!

      • Marius 2 months ago Reply

        How will I make the new message a link? Say for example ‘Request a quote!’ and I then make a link to a form?

  • Dwayne 2 months ago Reply

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

  • Shai 2 months ago Reply

    Working great. Thanks so much!

    • justin 2 months ago Reply

      Sweet! You’re welcome!

  • vicos2 2 months ago Reply

    not work with my template.

  • Brad Smith 2 months ago Reply

    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?

  • Brad Smith 2 months ago Reply

    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.woothemes.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.

    • justin 2 months ago Reply

      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!

      • Jeremy 2 months ago Reply

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

        • Max Rice 2 months ago Reply

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

  • Joe 2 months ago Reply

    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!

    • justin 2 months ago Reply

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

      • marv 2 months ago Reply

        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?

        • Justin Stern 2 months ago Reply

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

          • Garry 2 months ago

            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?

          • Max Rice 2 months ago

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

  • Kenny 2 months ago Reply

    Hey Justin

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

    • justin 2 months ago Reply

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

      • Joshua T Craig 21 weeks ago Reply

        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.

        • Justin Stern 20 weeks ago Reply

          Yeah, not sure I’ll admit… every theme is different of course and there’s no pleasing them all, ha ha

  • Kevin 2 months ago Reply

    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

    • justin 2 months ago Reply

      Hey Kevin, I think I know just what you mean, and I’ve had another person ask about this as well. I’m working on a plugin solution, would you be interested in testing this once it’s done?

      • Kevin 2 months ago Reply

        Hello Justin, Please!! I would like to test is soon. When is it possible to test? You can send me an email :) (you made my day)

        • justin 2 months ago Reply

          Well, it’s tough for me to say exactly how long it will take with everything else going on, but I’ll be in touch

          • Christina 2 months ago

            I’m also interested in this functionality. How is it going?

          • Max Rice 2 months ago

            At the top of our list, in the meantime you can check out the Catalog Visibility Options extension.

  • Kevin 2 months ago Reply

    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?

  • Luca 2 months ago Reply

    thx! very helpful

  • Araceli 2 months ago Reply

    Thank you! Just what I needed :)

  • T.J. 2 months ago Reply

    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!

    • Max Rice 2 months ago Reply

      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.

  • Tom Jones 2 months ago Reply

    Hi Justin,

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

    Thanks!

    • Max Rice 2 months ago Reply

      Hey Tom, I updated the article to also hide the selected product price label, enjoy :)

  • Alessandro 2 months ago Reply

    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.

    • Max Rice 2 months ago Reply

      Hil Alessandro, are these products that still show free on sale?

  • Damion 2 months ago Reply

    didnt work for me, is there an alternate option?

    • Max Rice 2 months ago Reply

      what didn’t work exactly?

  • karen 2 months ago Reply

    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?

    • Max Rice 2 months ago Reply

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

  • Veronica 2 months ago Reply

    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?

    • Max Rice 2 months ago Reply

      What’s the error message that PHP gives you?

  • Darren 2 months ago Reply

    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 ;-)

    • Justin Stern 1 month ago Reply

      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

  • Devin Walker 1 month ago Reply

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

  • Smittyhead 1 month ago Reply

    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’;
    }

  • Rocket Robin 1 month ago Reply

    This worked beautifully! Thanks!

  • Carsten 1 month ago Reply

    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

    • Justin Stern 1 month ago Reply

      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

  • Tan 1 month ago Reply

    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!!

    • Mattias 14 weeks ago Reply

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

  • elson 1 month ago Reply

    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

    • Max Rice 29 weeks ago Reply

      Try overriding the variable product template :)

    • Brian 7 weeks ago Reply

      I need this too. i need to calculate shipping later.

  • Andreas 27 weeks ago Reply

    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

    • Beka Rice 24 weeks ago Reply

      Hi Andreas, please see my comment to Luigi below.

  • David LeBlanc 26 weeks ago Reply

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

    Dave LeBlanc

  • Luigi 24 weeks ago Reply

    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?

    • Beka Rice 24 weeks ago Reply

      Hi Luigi,
      Unfortunately there is no extension that does exactly what you’re looking for. You can try this: http://www.woothemes.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!

  • Jomon 24 weeks ago Reply

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

  • Luigi 24 weeks ago Reply

    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?

    • Beka Rice 24 weeks ago Reply

      Buongiorno! Grazie per il tuo commento. Si prega di vedere la mia risposta alla tua domanda precedente in inglese.

  • Stoan 24 weeks ago Reply

    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

    • Justin Stern 21 weeks ago Reply

      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!

  • connie 22 weeks ago Reply

    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

  • connie 22 weeks ago Reply

    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

  • Heleen 22 weeks ago Reply

    Works great, thanks!

  • Tom 17 weeks ago Reply

    Thanks Justin – worked instantly.

  • Davred 12 weeks ago Reply

    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 …

  • Leanne 9 weeks ago Reply

    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!

  • Brian 7 weeks ago Reply

    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.

  • Joseph Kibler 4 weeks ago Reply

    The easiest way to do this is with css:

    .woocommerce span.free {
    display:none;
    }

    BAM DONE!

  • David LeBlanc 2 weeks ago Reply

    Thanks. This worked perfectly.

Submit a Comment