{"id":1966887,"date":"2025-10-22T05:01:55","date_gmt":"2025-10-22T09:01:55","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?p=1966887"},"modified":"2026-04-15T19:24:48","modified_gmt":"2026-04-15T23:24:48","slug":"customizing-event-cost","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/customizing-event-cost\/","title":{"rendered":"Customizing the Event Cost Display"},"content":{"rendered":"\n<p>By default, The Events Calendar and Event Tickets display <strong>Free<\/strong> when an event&#8217;s cost is zero, and show a price range (e.g. <strong>Free \u2013 $10<\/strong>) when an event has both free and paid tickets. This article covers the available snippets for customizing that behavior: renaming the &#8220;Free&#8221; label to something else, replacing it with a numeric zero, removing it from mixed cost ranges, and controlling which end of a price range is shown.<\/p>\n\n\n\n<p>All PHP snippets can be added via your child theme&#8217;s <code>functions.php<\/code> file or using the <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Code Snippets plugin<\/a>. See <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/best-practices-for-implementing-custom-code-snippets\/\">Best Practices for Implementing Custom Code Snippets<\/a> for guidance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-renaming-the-free-label\">Renaming the &#8220;Free&#8221; Label<\/h2>\n\n\n\n<p>When an event&#8217;s cost is set to zero, the front end displays it as <strong>Free<\/strong>. You can rename this to any text you prefer \u2014 for example &#8220;Complimentary&#8221;, &#8220;No Charge&#8221;, or a numeric <strong>0<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/theeventscalendar.com\/knowledgebase\/wp-content\/uploads\/2019\/10\/tec-free-to-zero-2.jpg\" alt=\"An event showing 'Free' as the displayed ticket cost\"\/><\/figure>\n\n\n\n<p>There are two ways to do this.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-option-1-php-snippet\">Option 1: PHP Snippet<\/h4>\n\n\n\n<p>Add the following to your <code>functions.php<\/code> file. Change <code>'0'<\/code> to whatever you want the label to say \u2014 it is case-sensitive.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfunction tribe_tec_rename_free_label( $translation, $text, $domain ) {\n    $custom_text = &#x5B; &#039;Free&#039; =&gt; &#039;0&#039; ]; \/\/ Replace &#039;0&#039; with your preferred label\n\n    if ( 0 === strpos( $domain, &#039;the-events-calendar&#039; ) &amp;amp;&amp;amp; array_key_exists( $translation, $custom_text ) ) {\n        $translation = $custom_text&#x5B; $translation ];\n    }\n\n    return $translation;\n}\nadd_filter( &#039;gettext&#039;, &#039;tribe_tec_rename_free_label&#039;, 20, 3 );\n<\/pre><\/div>\n\n\n<p>\ud83d\udc4b <strong>Note:<\/strong> This uses the <code>gettext<\/code> filter and applies to The Events Calendar plugin&#8217;s text domain. If you are using Event Tickets or Event Tickets Plus and the label is still showing after applying this snippet, the <code>tribe_get_cost<\/code> approach in the next section may be needed instead.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-option-2-the-say-what-plugin\">Option 2: The Say What? Plugin<\/h4>\n\n\n\n<p>The <a href=\"https:\/\/wordpress.org\/plugins\/say-what\/\">Say What?<\/a> plugin provides a user interface for WordPress string replacements without writing code, and does the same thing as the snippet above.<\/p>\n\n\n\n<p>After installing and activating the plugin, go to <strong>Tools \u2192 Text Changes<\/strong> and add a new entry:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/theeventscalendar.com\/knowledgebase\/wp-content\/uploads\/2019\/10\/tec-free-to-zero-say-what.jpg\" alt=\"The Say What? plugin interface showing a text replacement entry for 'Free'\"\/><\/figure>\n\n\n\n<p>Click <strong>Save<\/strong> and the label will update on the front end.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-removing-free-from-a-mixed-cost-range\">Removing &#8220;Free&#8221; from a Mixed Cost Range<\/h2>\n\n\n\n<p>If your event has both free tickets (or RSVPs) and paid tickets, the cost display defaults to a range \u2014 for example, <strong>Free \u2013 $10<\/strong>. If you would rather not show &#8220;Free&#8221; in this range at all, the following snippet removes it along with the dash separator, leaving only the paid price.<\/p>\n\n\n\n<p>This uses the <code>tribe_get_cost<\/code> filter, which works with Event Tickets and Event Tickets Plus.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfunction tribe_not_show_free( $cost, $post_id, $with_currency_symbol ) {\n    $regex = &#039;\/Free\/&#039;;\n    $match = preg_match( $regex, $cost );\n\n    if ( $cost == 0 || $cost == &#039;Free&#039; || $match ) {\n        $cost = str_replace( &#039;Free&#039;, &#039; &#039;, $cost );\n        $cost = str_replace( &#039; \u2013 &#039;, &#039; &#039;, $cost );\n    }\n\n    return $cost;\n}\nadd_filter( &#039;tribe_get_cost&#039;, &#039;tribe_not_show_free&#039;, 10, 3 );\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-showing-only-one-end-of-a-price-range\">Showing Only One End of a Price Range<\/h2>\n\n\n\n<p>When multiple tickets exist for an event, the cost displays as a range (e.g. <strong>$5 \u2013 $50<\/strong>). This can be confusing in cases like early bird pricing, where the lower price is no longer available. The following snippet lets you replace the range with either the lowest price (with optional prefixed text) or the highest price only.<\/p>\n\n\n\n<p>Add the snippet to your <code>functions.php<\/code> file or via Code Snippets. Before saving, delete the block you <em>do not<\/em> want \u2014 either the lowest-price block or the highest-price block.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfunction tec_remove_price_range( $cost, $post_id, $with_currency_symbol ) {\n    $pieces = explode( &#039; \u2013 &#039;, $cost );\n\n    \/\/ If the ticket is free, just display it as-is.\n    if ( $cost == &#039;Free&#039; ) {\n        return $cost;\n    }\n\n    \/\/ DELETE the block below if you want to show only the highest price instead.\n    \/\/ To show the lowest price with prefix text:\n    if ( ! empty( $pieces&#x5B;0] ) ) {\n        return &#039;Starting from &#039; . $pieces&#x5B;0];\n    }\n\n    \/\/ DELETE the block above if you want to show only the lowest price.\n    \/\/ To show the highest price with prefix text:\n    if ( ! empty( $pieces&#x5B;1] ) ) {\n        return &#039;Up to &#039; . $pieces&#x5B;1];\n    }\n\n    \/\/ If not a range, return the default value.\n    return $cost;\n}\nadd_filter( &#039;tribe_get_cost&#039;, &#039;tec_remove_price_range&#039;, 10, 3 );\n<\/pre><\/div>\n\n\n<p>Showing the lowest price with &#8220;Starting from&#8221; prefix:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/09\/Starting.jpg\" alt=\"Event cost showing 'Starting from $5' instead of a full price range\"\/><\/figure>\n\n\n\n<p>Showing only the highest price with &#8220;Up to&#8221; prefix (remove lines 9\u201312 from the snippet above):<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/09\/Up-to-Price-1.png\" alt=\"Event cost showing 'Up to $50' instead of a full price range\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-disclaimer\">Disclaimer<\/h2>\n\n\n\n<p>As with all of our snippets, please note that we share these in the hope they will be useful <strong>but without any guarantees or commitments<\/strong>. If you wish to use them, it is your responsibility to test them and adapt them to your needs (or find someone who can do so on your behalf). We are unable to provide further support in relation to these snippets.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, The Events Calendar and Event Tickets display Free when an event&#8217;s cost is zero, and show a price range (e.g. Free \u2013 $10) when an event has both free and paid tickets. This article covers the available snippets for customizing that behavior: renaming the &#8220;Free&#8221; label to something else, replacing it with a&#8230;<\/p>\n","protected":false},"author":63,"featured_media":1955565,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[24,128,59],"tags":[],"stellar-product-taxonomy":[161],"class_list":["post-1966887","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-languages-translations","category-php-function-snippets","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":128,"label":"Languages &amp; Translations"},{"value":59,"label":"PHP Functions &amp; Snippets"}],"stellar-product-taxonomy":[{"value":161,"label":"The Events Calendar"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Tristan","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/tristan\/"},"comment_info":0,"category_info":[{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":76,"filter":"raw","term_order":"0","cat_ID":24,"category_count":76,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":128,"name":"Languages &amp; Translations","slug":"languages-translations","term_group":0,"term_taxonomy_id":128,"taxonomy":"category","description":"","parent":61,"count":5,"filter":"raw","term_order":"0","cat_ID":128,"category_count":5,"category_description":"","cat_name":"Languages &amp; Translations","category_nicename":"languages-translations","category_parent":61},{"term_id":59,"name":"PHP Functions &amp; Snippets","slug":"php-function-snippets","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":63,"filter":"raw","term_order":"0","cat_ID":59,"category_count":63,"category_description":"","cat_name":"PHP Functions &amp; Snippets","category_nicename":"php-function-snippets","category_parent":24}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1966887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1966887"}],"version-history":[{"count":3,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1966887\/revisions"}],"predecessor-version":[{"id":1969164,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1966887\/revisions\/1969164"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1966887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1966887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1966887"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1966887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}