Creating a custom Thank You page in WooCommerce can enhance the post-purchase experience for your customers. A custom Thank You page allows you to provide personalised messages, special offers, and additional information that can help increase customer satisfaction and drive repeat business. In this guide, we will show you how to redirect customers to a custom Thank You page in WooCommerce without using a plugin.
Why Create a Custom Thank You Page?
A custom Thank You page offers several benefits:
- Personalisation: Provide a tailored message to thank customers for their purchase.
- Cross-Selling: Recommend additional products or services.
- Customer Engagement: Offer discounts or promotions for future purchases.
- Branding: Reinforce your brand’s identity and values.
Step 1: Create Your Custom Thank You Page
First, you need to create a new page in WordPress that will serve as your custom Thank You page. Follow these steps:
- Go to Pages > Add New in your WordPress dashboard.
- Title the page something like “Thank You” or “Order Confirmation”.
- Add your custom content to the page. This could include a thank you message, special offers, recommended products, or any other information you want to share.
- Publish the page.
Make a note of the URL of your custom Thank You page.
Step 2: Redirect to the Custom Thank You Page
Next, you need to add some code to your theme’s functions.php file to redirect customers to the custom Thank You page after they complete a purchase. Add the following code:
/*
* * Snippet: How to Redirect to Custom Thank You Page in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1299
* Tested with WooCommerce 10.7.0
* "Redirect to custom thank you page"
*/
function wcsuccess_custom_thank_you_page_redirect($order_id) {
// Get the order
$order = wc_get_order($order_id);
// Replace the URL with your custom thank you page URL
$custom_thank_you_url = home_url('/thank-you/');
// Redirect to custom thank you page
if (!is_admin()) {
wp_safe_redirect($custom_thank_you_url);
exit;
}
}
add_action('woocommerce_thankyou', 'wcsuccess_custom_thank_you_page_redirect');
In the code above, replace /thank-you/ with the URL slug of your custom Thank You page.
Step 3: Test Your Custom Thank You Page
To ensure everything is working correctly, perform a test purchase on your WooCommerce store. After completing the order, you should be redirected to your custom Thank You page.
Additional Customisation
To make the most of your custom Thank You page, consider adding the following elements:
- Order Summary: Display a summary of the customer’s order using the following shortcode in the page content:
/*
* * Snippet: How to Redirect to Custom Thank You Page in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1299
* Tested with WooCommerce 10.7.0
* "Display order summary on thank you page"
*/
add_shortcode('order_summary', 'wcsuccess_display_order_summary');
function wcsuccess_display_order_summary() {
if (isset($_GET['order_id'])) {
$order_id = sanitize_text_field($_GET['order_id']);
$order = wc_get_order($order_id);
if ($order) {
echo '<h2>Order Summary</h2>';
foreach ($order->get_items() as $item) {
echo '<p>' . $item->get_name() . ' x ' . $item->get_quantity() . '</p>';
}
}
}
}
- Related Products: Recommend related products to encourage additional purchases.
- Social Media Links: Encourage customers to follow you on social media for updates and promotions.
- Newsletter Signup: Offer an easy way for customers to subscribe to your newsletter.
Use Cases for Custom Thank You Pages
- Seasonal Campaigns: Tailor the Thank You page content for different seasons or holidays to align with your marketing campaigns.
- VIP Customers: Create a special Thank You page for VIP customers, offering exclusive deals and rewards.
- Feedback Collection: Include a short survey to gather customer feedback on their shopping experience.
- Referral Programs: Promote your referral program and encourage customers to refer friends and family.
Conclusion
Redirecting customers to a custom Thank You page in WooCommerce is a powerful way to enhance the post-purchase experience and drive additional engagement. By following the steps outlined in this guide, you can create a personalised Thank You page that reinforces your brand and encourages repeat business. Customise the content and design to fit your store’s unique needs and watch your customer satisfaction and sales grow.
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

