{"id":4664,"date":"2025-04-15T09:03:28","date_gmt":"2025-04-15T09:03:28","guid":{"rendered":"https:\/\/scriptfeeds.com\/blog\/?p=4664"},"modified":"2025-04-15T10:49:37","modified_gmt":"2025-04-15T10:49:37","slug":"add-text-after-prices-in-products","status":"publish","type":"post","link":"https:\/\/scriptfeeds.com\/blog\/wordpress\/add-text-after-prices-in-products\/","title":{"rendered":"How to add Text after price in WooCommerce products"},"content":{"rendered":"\n<p>Sometimes , you may have to add few text after price in WooCommerce products. This text can be anything like <strong>(Tax inclusive)<\/strong> or may be <strong>(Fees and Tax inclusive)<\/strong> . These text after prices can help customer to understand the price break of your product.<\/p>\n\n\n\n<p>Here&#8217;s how you can show a line like <strong>&#8220;(Fees &amp; Tax included)&#8221;<\/strong> or any other text right after the <strong>price<\/strong> in <a href=\"https:\/\/scriptfeeds.com\/blog\/category\/wordpress\/woocommerce\/\" data-type=\"category\" data-id=\"86\">WooCommerce <\/a>Products<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#if-you-want-to-add-for-specific-product\">If you want to add for Specific Product:<\/a><ul><li><a href=\"#what-it-does\">What it does:<\/a><\/li><\/ul><\/li><li><a href=\"#if-you-want-to-add-for-multiple-products\">If you want to add for Multiple Products:<\/a><\/li><li><a href=\"#code-for-specific-text-per-product\">Code for Specific Text Per Product:<\/a><ul><li><a href=\"#how-to-use\">How to use?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\" id=\"if-you-want-to-add-for-specific-product\"><strong>If you want to add for Specific Product:<\/strong><\/h2>\n\n\n\n<p style=\"font-size:16px\"><strong>Add this to your theme\u2019s <code>function.php<\/code><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter('woocommerce_get_price_html', 'scriptfeeds_add_tax_info_to_price', 20, 2);\nfunction scriptfeeds_add_tax_info_to_price($price, $product) {\n    \/\/ Replace 1428 with your specific product ID\n    if ($product->get_id() == 1428) {\n        $price .= ' &lt;span style=\"font-size:14px; color:#666;\">(Fees &amp; Tax included)&lt;\/span>';\n    }\n    return $price;\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-it-does\"><strong>What it does:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Only applies to product ID <strong>1428<\/strong> (change to your desired product).<\/li>\n\n\n\n<li>Appends a clean line after the price.<\/li>\n\n\n\n<li>Customizable styling with font size and color.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"981\" height=\"162\" src=\"https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2025\/04\/image-5.png\" alt=\"Quick ways to add Text after price in WooCommerce products\" class=\"wp-image-4670\" srcset=\"https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2025\/04\/image-5.png 981w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2025\/04\/image-5-300x50.png 300w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2025\/04\/image-5-150x25.png 150w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2025\/04\/image-5-768x127.png 768w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2025\/04\/image-5-399x66.png 399w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2025\/04\/image-5-800x132.png 800w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2025\/04\/image-5-750x124.png 750w\" sizes=\"(max-width: 981px) 100vw, 981px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\" id=\"if-you-want-to-add-for-multiple-products\"><strong>If you want to add for Multiple Products:<\/strong><\/h2>\n\n\n\n<p>Add below code in <a href=\"https:\/\/developer.wordpress.org\/themes\/advanced-topics\/child-themes\/\" target=\"_blank\" rel=\"noopener\"><strong>function.php<\/strong> file of your child theme<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter('woocommerce_get_price_html', 'scriptfeeds_add_tax_info_to_price', 20, 2);\nfunction scriptfeeds_add_tax_info_to_price($price, $product) {\n    \/\/ Add all product IDs you want to target\n    $target_product_ids = &#91;1428, 1430, 1442]; \/\/ replace with your product ID's or Add more IDs as needed\n\n    if (in_array($product->get_id(), $target_product_ids)) {\n        $price .= ' &lt;span style=\"font-size:14px; color:#666;\">(Fees &amp; Tax included)&lt;\/span>';\n    }\n    return $price;\n}\n<\/code><\/pre>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-link-color wp-elements-7a27145f78ff2876a8a782a80a1d134e\">You can add as many product ID&#8217;s you want. Don&#8217;t forget to replace your product ID&#8217;s in above code<\/p>\n\n\n\n<p>There can be a situation where you wanna show different text after price for different products. In that case you can use below code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\" id=\"code-for-specific-text-per-product\"><strong>Code for Specific Text Per Product:<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter('woocommerce_get_price_html', 'scriptfeeds_add_custom_text_to_price', 20, 2);\nfunction scriptfeeds_add_custom_text_to_price($price, $product) {\n    \/\/ Set custom text for specific product IDs\n    $custom_texts = &#91;\n        1428 => '(Fees &amp; Tax included)',\n        1430 => '(Includes free vaccination)',\n        1442 => '(Early bird offer applied)',\n    ];\n\n    $product_id = $product->get_id();\n\n    if (array_key_exists($product_id, $custom_texts)) {\n        $price .= ' &lt;span style=\"font-size:14px; color:#666;\">' . esc_html($custom_texts&#91;$product_id]) . '&lt;\/span>';\n    }\n\n    return $price;\n}\n<\/code><\/pre>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-link-color wp-elements-7a27145f78ff2876a8a782a80a1d134e\">You can add as many product ID&#8217;s you want. Don&#8217;t forget to replace your product ID&#8217;s in above code<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-use\"><strong>How to use?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Just replace or add to the <code>$custom_texts<\/code> array with your own product IDs and messages.<\/li>\n\n\n\n<li>Styling can also be adjusted per message if needed.<\/li>\n<\/ul>\n\n\n\n<p>So that&#8217;s all you have to do for adding &#8220;Text after price&#8221; in WooCommerce Products. For any other customization features, you can connect with our developers.<\/p>\n\n\n\n<p>Happy coding<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes , you may have to add few text after price in WooCommerce products. This text can be anything like (Tax inclusive) or may be (Fees and Tax inclusive) . These text after prices can help customer to understand the price break of your product. Here&#8217;s how you can show a line like &#8220;(Fees &amp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jnews-multi-image_gallery":[],"jnews_single_post":{"format":"standard"},"jnews_primary_category":[],"footnotes":""},"categories":[75],"tags":[],"class_list":["post-4664","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/posts\/4664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/comments?post=4664"}],"version-history":[{"count":0,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/posts\/4664\/revisions"}],"wp:attachment":[{"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/media?parent=4664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/categories?post=4664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/tags?post=4664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}