Skip to content
GPLWP Guides

How to customize WooCommerce thank-you pages

WooCommerce Time About 30 minutes 6 steps Updated 21 Sep 2026

WOOCOMMERCE
The short answer

WooCommerce’s default thank-you page can be changed with hooks or an upgrade-safe template override. For different pages by product, category, payment method or order value, use a dedicated plugin instead of maintaining increasingly complex custom code.

The route
  1. 01Choose the type of change
  2. 02Check your checkout setup
  3. 03Add small changes with hooks
  4. 04Override the thank-you template
  5. 05Redirect only when necessary
  6. 06Test every order outcome

What you need

  • A WooCommerce store on WordPress 6.0 or later
  • Administrator access
  • A child theme or code-snippet tool for custom PHP
  • A test payment method or a way to place test orders

Choose the type of change

WooCommerce calls this the order-received page. Decide whether you only need extra text or tracking, a redesigned layout, a redirect, or different content for different orders.

Extra text and small additions are usually fine with hooks. A full layout change needs a template override or a page-builder-style plugin. Product-, category-, payment-method- and order-based rules are where manual code becomes harder to maintain.

Check your checkout setup

Find out whether the store uses the classic checkout shortcode or the Checkout block. Newer WooCommerce stores commonly use Cart and Checkout blocks, while older stores may still use the shortcode. The checkout editor changes the checkout itself; it does not automatically give you a complete conditional thank-you-page system.

The thank-you page normally appears at the checkout’s order-received endpoint. It is not usually a separate page that you can open and edit from Pages, so do not create a second page until you have decided whether you are adding content, overriding the template or redirecting customers.

Add small changes with hooks

For a custom message near the order-received text, use the woocommerce_thankyou_order_received_text filter. For content or tracking after the order confirmation output, use the woocommerce_thankyou action. WooCommerce passes the order ID to the action, which lets your code read the order total, products and other order data.

Put the code in a child theme’s functions.php file or a code-snippet plugin, not the parent theme. Keep the message useful: delivery information, account instructions, a support contact or one relevant next step. Avoid printing private order data without checking the current order and customer context.

Override the thank-you template

For structural changes, copy WooCommerce’s wp-content/plugins/woocommerce/templates/checkout/thankyou.php file into wp-content/themes/your-child-theme/woocommerce/checkout/thankyou.php, then edit the copied file. WooCommerce loads the copy from the theme instead of the plugin’s original template.

This is safer than editing the plugin, but it creates maintenance work. WooCommerce can update the original template while your copy stays unchanged, so check the WooCommerce system-status template warnings after updates and merge relevant changes. A template override is best for a developer-controlled layout, not for store staff who need to change campaigns regularly.

Redirect only when necessary

A redirect can send customers to a normal WordPress page, landing page or product-specific destination, but it can also remove the standard order number, billing details, shipping details and payment instructions unless you rebuild them. The redirect must also preserve the correct order context and avoid running on unrelated checkout requests.

If you use custom PHP for a redirect, check the order-received endpoint and the order key before redirecting. Do not redirect failed or unpaid orders to a success page, and do not rely on a JavaScript redirect added after WooCommerce has already started rendering the response.

Test every order outcome

Place test orders for a successful payment, a failed payment and any pending or manual payment method you use. Check the page as a guest and a logged-in customer, then refresh the order-received URL to make sure the message or offer does not create duplicate orders or repeated tracking events.

Also test mobile layout, order details, downloadable products, tax and shipping text, and any payment gateway instructions. If the page shows a 404, review the checkout page and endpoint settings, then save the permalink settings once to refresh rewrite rules. If you need conditional pages, coupons, surveys, upsells and analytics without maintaining these cases yourself, the fast route is WPC Smart Thank You Page for WooCommerce. It is designed for targeted post-purchase pages based on products, categories, payment methods or order values.

The fast route

Let WPC Smart Thank You Page for WooCommerce do it

Conditional post-purchase pages with coupons, surveys, upsells, and analytics for stores outgrowing WooCommerce’s default thank-you screen.

Get WPC Smart Thank You Page for WooCommerce

Sources

  1. woocommerce.com /document/woocommerce-customizer/checkout/?utm_source=openai
  2. rudrastyh.com /woocommerce/thank-you-page.html?utm_source=openai
  3. woocommerce.com /document/custom-tracking-code-for-the-thanks-page/?utm_sour…
  4. developer.woocommerce.com /docs/theming/theme-development/template-structure?utm_sourc…
  5. storeapps.org /woocommerce-order-received-page/?utm_source=openai
  6. woocommerce.com /document/customized-thank-you-pages/?utm_source=openai

Questions

Can I edit the WooCommerce thank-you page from Pages?
Usually, no. WooCommerce normally renders the thank-you page through the checkout’s order-received endpoint rather than a regular WordPress page. Add simple content with WooCommerce hooks, change the markup with a child-theme template override, or use a plugin that maps custom pages to order conditions. Creating an ordinary page alone will not replace the default confirmation screen.
What is the safest way to add a message?
The safest small change is to use WooCommerce’s thank-you hooks from a child theme or code-snippet plugin. Use the order-received text filter for the confirmation message and the thank-you action for additional output or tracking. Do not edit WooCommerce plugin files or the parent theme, because updates can remove those changes.
Why did my order details disappear after a redirect?
A redirect leaves WooCommerce’s normal order-received template, so the destination page will not automatically contain the order number, totals, billing details, shipping details or gateway instructions. Either keep the native page and add content with hooks, or deliberately rebuild the required order information on the destination while checking the order context securely.
Will a template override survive WooCommerce updates?
The copied template usually survives a WooCommerce update, but it can become outdated. WooCommerce updates its original templates separately, so review the system-status template warnings and compare your child-theme copy with the current plugin version after updates. This is why hooks are preferable for small additions and overrides are better reserved for structural changes.
When should I use a thank-you-page plugin?
Use a plugin when you need different confirmation experiences based on products, categories, payment methods or order values, especially when you also want coupons, surveys, upsells or analytics. Manual hooks are fine for one message or tracking script, but conditional rules quickly become harder to test and maintain.