Customising your WooCommerce store is a powerful way to enhance user experience and drive conversions. One simple but effective modification is adding a custom message at checkout. This guide will walk you through how to add this custom functionality directly to your theme’s functions.php file, avoiding the need for additional plugins.
Why Custom Checkout Messages Matter
Custom messages at checkout can help in various ways, such as reminding customers of a special offer, providing essential information, or simply adding a personal touch. Since this method does not rely on external plugins, it ensures that your site remains lightweight and efficient.
Getting Started
Before we dive into the code, it’s crucial to create a child theme if you haven’t done so already. This ensures that any modifications you make are preserved even when you update your main theme. You can use our free child theme generator to get started quickly.
Adding a Custom Message to WooCommerce Checkout
To add a custom message to the WooCommerce checkout page, you’ll be working with the functions.php file of your child theme. The code snippet below will display a custom message to your customers at the checkout stage.
Customising your WooCommerce store
/**
* Snippet: How to Display a Custom WooCommerce Message on Checkout – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1441
* Tested with WooCommerce 10.7.0
* "Adds a custom message to the WooCommerce checkout page"
*/
function wcsuccess_custom_checkout_message() {
echo '<p class="custom-checkout-message">Thank you for shopping with us! Don’t forget to check out our latest offers.</p>';
}
add_action('woocommerce_before_checkout_form', 'wcsuccess_custom_checkout_message');
In this example, the wcsuccess_custom_checkout_message function is hooked to woocommerce_before_checkout_form, meaning the message will appear just before the checkout form. You can easily change the position by selecting a different WooCommerce hook.
Customising the Message
The message displayed can be easily customised to fit your needs. For instance, if you want to add urgency or a call to action, simply edit the text within the <p> tags.
/**
* Snippet: How to Display a Custom WooCommerce Message on Checkout – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1441
* Tested with WooCommerce 10.7.0
* "Adds a promotional message to the WooCommerce checkout page"
*/
function wcsuccess_custom_checkout_message() {
echo '<p class="custom-checkout-message">Limited time offer! Use code SAVE10 at checkout to get 10% off your next purchase.</p>';
}
add_action('woocommerce_before_checkout_form', 'wcsuccess_custom_checkout_message');
This snippet demonstrates how to include a promotional message. Just ensure the content aligns with your marketing goals.
Styling the Message
You can also style the message to match your theme. Add the following CSS to your theme’s stylesheet:
.custom-checkout-message {
font-size: 16px;
color: #333;
background-color: #f9f9f9;
padding: 10px;
border-radius: 5px;
text-align: center;
margin-bottom: 20px;
}
This CSS will style the message, making it stand out while still fitting within the overall design of your store.
Removing the Custom Message
If you ever need to remove the custom message, it’s as simple as removing the function from your functions.php file.
/**
* Snippet: How to Display a Custom WooCommerce Message on Checkout – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1441
* Tested with WooCommerce 10.7.0
* "Removes the custom message from the WooCommerce checkout page"
*/
function wcsuccess_remove_custom_checkout_message() {
remove_action('woocommerce_before_checkout_form', 'wcsuccess_custom_checkout_message');
}
add_action('init', 'wcsuccess_remove_custom_checkout_message');
Best Practices
- Testing: Always test your code on a staging site before implementing it on your live site to avoid any disruptions.
- Backups: Regularly back up your
functions.phpfile to prevent accidental data loss. - Keep It Simple: While customising, avoid overloading your checkout page with too many messages or elements, as this can overwhelm the customer.
Conclusion
Adding a custom WooCommerce message at checkout is a simple yet effective way to enhance user experience. By placing the code directly in your child theme’s functions.php file, you keep your site lightweight and avoid the pitfalls of plugin dependency. Don’t forget to create a child theme before making any changes, and feel free to explore other customisations to make your WooCommerce store truly unique.
By following this guide, you’ll be well on your way to creating a more engaging and customised checkout experience for your customers.
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

