// Add a filter to customize the WooCommerce thank you page URL
function custom_thankyou_page_redirect($order_id) {
// Replace ‘custom-thankyou-page’ with the slug or URL of your custom thank you page
$thankyou_page_url = home_url(‘/thank-you-page/’);
return $thankyou_page_url;
}
add_filter(‘woocommerce_get_checkout_order_received_url’, ‘custom_thankyou_page_redirect’);
// Optionally, you can add a message or content to your custom thank you page
function custom_thankyou_page_content() {
echo ‘
Thank You for Your Order
‘;
echo ‘
Your custom thank you message or content here.
‘;
}
add_action(‘woocommerce_thankyou_custom-thankyou-page’, ‘custom_thankyou_page_content’);