Displaying the sale price end date on your WooCommerce store can create a sense of urgency, encouraging customers to make a purchase before the discount period ends. This guide will show you how to display the sale price end date on both the shop and single product pages without using a plugin. By implementing this feature, you can enhance your store’s appeal and drive more sales.
Why Display the Sale Price End Date?
- Create Urgency: Letting customers know when a sale ends can prompt quicker purchasing decisions.
- Transparency: Provides clear information to customers about the duration of your discounts.
- Increased Engagement: Encourages customers to revisit your store to check for future sales.
Step 1: Add the End Date to the Single Product Page
First, we need to display the sale end date on the single product page. Add the following code to your theme’s functions.php file:
/*
* Snippet: How to Display Sale Price End Date at Shop & Single Product Page in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1305
* Tested with WooCommerce 10.7.0
* "Display sale end date on single product page"
*/
function wcsuccess_display_sale_end_date_single_product() {
global $product;
if ($product->is_on_sale()) {
$sale_end_date = get_post_meta($product->get_id(), '_sale_price_dates_to', true);
if ($sale_end_date) {
echo '<p class="sale-end-date">Sale ends on: ' . date('F j, Y', $sale_end_date) . '</p>';
}
}
}
add_action('woocommerce_single_product_summary', 'wcsuccess_display_sale_end_date_single_product', 25);
Step 2: Add the End Date to the Shop Page
Next, we need to display the sale end date on the shop (archive) page. Add the following code to your theme’s functions.php file:
/*
* Snippet: How to Display Sale Price End Date at Shop & Single Product Page in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1305
* Tested with WooCommerce 10.7.0
* "Display sale end date on shop page"
*/
function wcsuccess_display_sale_end_date_shop_page() {
global $product;
if ($product->is_on_sale()) {
$sale_end_date = get_post_meta($product->get_id(), '_sale_price_dates_to', true);
if ($sale_end_date) {
echo '<p class="sale-end-date">Sale ends on: ' . date('F j, Y', $sale_end_date) . '</p>';
}
}
}
add_action('woocommerce_after_shop_loop_item', 'wcsuccess_display_sale_end_date_shop_page', 25);
Step 3: Style the Sale End Date
To make the sale end date visually appealing, add some CSS to your theme’s stylesheet (style.css). Here’s an example of how you might style it:
/*
* Snippet: How to Display Sale Price End Date at Shop & Single Product Page in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1305
* Tested with WooCommerce 10.7.0
* "Style the sale end date"
*/
.sale-end-date {
font-size: 14px;
color: #FF0000;
font-weight: bold;
margin-top: 10px;
}
Use Cases for Displaying Sale End Date
- Holiday Sales: Inform customers about the end date of holiday-specific discounts to boost urgency and sales during peak shopping seasons.
- Limited-Time Offers: Use this feature to highlight limited-time offers, encouraging customers to purchase before the discount period ends.
- Clearance Sales: Display end dates for clearance items to push sales before the stock runs out.
- Marketing Campaigns: Combine the end date display with marketing campaigns to drive traffic and conversions.
- Customer Trust: By being transparent about sale durations, you build trust with your customers, showing that your discounts are genuine and time-limited.
Conclusion
Displaying the sale price end date on both the shop and single product pages in WooCommerce is a powerful way to drive sales and create a sense of urgency. By following the steps outlined above, you can easily implement this feature without using a plugin, enhancing the shopping experience for your customers and boosting your store’s performance.
I have been working with WordPress and WooCommerce since 2012 and have developed a deep knowledge of the content management system. Since 2012, I have developed several plugins and designed dozens of websites utilising different frameworks, CMS’s and programming languages. I am proficient in PHP, Python, Java, C, C++, R and JavaScript with limited experience in Go, Kotlin and Swift.
Educationally, I have a Master’s degree in cyber security a Bachelor’s (Hons, First Class) in Applied Research and a Graduate Certificate in Data Science. I’m currently undertaking PhD studies investigating IoT cybersecurity. I recently graduated with First Class Honours and Masters of Information Technology, receiving the Executive Dean’s Award for studies undertaken in the 2021 and 2022 academic years. I have worked in the information technology industry for the past 11 years primarily as a software/web developer specific to design, optimisation, network management and security. My research interests are in the areas of Internet of Things (IoT), 5G and Beyond Networks, information security for wireless networks and software development.
Stay In Touch

