WordPress filter hook
woocommerce_thankyou_order_id
Defined by WooCommerce and fired by 47 plugins in total, running on 10.1M+ sites between them.
“Filters the ID of the order shown on the thanks page.”
How to use woocommerce_thankyou_order_id
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_thankyou_order_id', function( $order_id ) {
// Change $order_id here.
return $order_id;
}, 10, 1 );Argument names come from GTM4WP's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
47 plugins that fire woocommerce_thankyou_order_id
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $order_id ) )includes/shortcodes/class-wc-shortcode-checkout.php:317 -
Essential Addons for Elementor1+ million installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $order_id ) )includes/Template/Woocommerce/Checkout/Woo_Checkout_Helper.php:75 -
WooPayments: Integrated WooCommerce Payments800,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ?? 0 ) )includes/class-wc-payments-order-success-page.php:421 -
GTM4WP700,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )src/Modules/WooCommerce/PageDataLayer.php:676 -
CartFlows200,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', empty( $_GET[ $id_param ] ) ? 0 : intval( $_GET[ $id_param ] ) )modules/thankyou/classes/class-cartflows-thankyou-markup.php:286 -
Mollie Payments for WooCommerce100,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($orderReceived) )src/Gateway/MolliePaymentGatewayHandler.php:331 -
Snapchat for WooCommerce90,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )includes/Utils/Helper.php:98 -
AI Powered Marketing40,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ?? 0 ) )classes/class-helper.php:149 -
Kliken: Ads + Pixel for Meta30,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( get_query_var( 'order-received', 0 ) ) )classes/class-tracker.php:955 -
GTM Kit30,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ?? 0 ) )src/Integration/WooCommerce.php:513 -
FunnelKit30,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )modules/thankyou-pages/includes/class-wfty-data.php:355 -
UiChemy8,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', isset( $wp->query_vars['order-received'] ) ? absint( $wp->query_vars['order-received'] ) : 0 )uichemy-composer/includes/admin/widgets/class-uichemy-woo-tags.php:428 -
LocalWeb All In One5,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )public/partials/lw-all-in-one-public-woocommerce-gtm.php:373 -
PayPlug for WooCommerce (Official)4,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($wp->query_vars['order-received']) )src/Gateway/PayplugGateway.php:260 -
WowStore4,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $order_id ) )classes/Functions.php:231 -
Ultimate Store Kit3,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($wp->query_vars['order-received']) )includes/helper.php:1547 -
Responsive Addons for Elementor3,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $order_id ) )traits/responsive-addons-for-elementor-woo-checkout-helper.php:101 -
Custom Thank You Page for WooCommerce2,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )includes/class-wccty-order-resolver.php:58 -
WSB HUB31,000+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) )includes/class-wsb-hub3-shortcodes.php:85 -
워드프레스 결제 심플페이900+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars[ 'order-received' ] ) )pgall-for-woocommerce.php:334 -
PlatiOnline Payments700+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($wp->query_vars['order-received']) )inc/core/class-wc-plationline-process.php:151 -
Mergado Pack600+ installs
apply_filters( 'woocommerce_thankyou_order_id', $orderId )includes/class-mergado-marketing-pack.php:806 -
Tealium600+ installs
apply_filters( 'woocommerce_thankyou_order_id', empty( $_GET['order'] ) ? ( $GLOBALS["wp"]->query_vars["order-received"] ? $GLOBALS["wp"]->query_vars["order-received"] : 0 ) : absint( $_GET['order'] ) )tealium.php:240 -
remarketable500+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $order_id ) )assets/NSAFaceBookPixel.php:293 -
Rapyd Payment Extension for WooCommerce500+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($wp->query_vars['order-received']) )includes/abstracts/abstract-wc-rapyd-payment-gateway.php:84 -
Fathom Analytics Conversions400+ installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )admin/class-fathom-analytics-conversions-woocommerce.php:78 -
Noah Shop Builder for WooCommerce400+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) )includes/Templates/Types/OrderReceived.php:189 -
Custom Thank You for WooCommerce300+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $_GET['order'] ) )includes/class-ctyw-settings.php:169 -
Tapfiliate300+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($GLOBALS['order-received']) )woocommerce/tracking-code.php:26 -
Synctrack200+ installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )includes/class-rh-easy-helper.php:91 -
Trade Runner100+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($GLOBALS['order-received']) )traderunner.php:277 -
Omnivore100+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($GLOBALS['order-received']) )omnivore.php:277 -
LSX Customizer100+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) )classes/class-lsx-customizer-woocommerce.php:342 -
Custom Thank You Pages PRO for WooCommerce90+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $_GET['order'] ) )wc-custom-thank-you-pages.php:116 -
eBay Link90+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($GLOBALS['order-received']) )ebaylink.php:277 -
Paiement par Carte DAHABIA et Carte CIB for WooCommerce70+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint(sanitize_key($_GET['id'])) )paiement-par-carte-dahabia-et-cib-for-woocommerce.php:106 -
Beslist Tracking60+ installs
apply_filters( 'woocommerce_thankyou_order_id', $orderID )src/WooCommerceWebhookHandler.php:428 -
2Checkout Dynamic Payment Gateway for WooCommerce40+ installs
apply_filters( 'woocommerce_thankyou_order_id', empty( $_GET['order'] ) ? 0 : absint( $_GET['order'] ) )gateway-2Checkout.php:102 -
Datalayer Tracking via DATA Reshape for WooCommerce20+ installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )includes/trait-frontend.php:230 -
Custom Thank you for Woo10+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $_GET['order'] ) )index.php:114 -
Max Elements for Elementor10+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint($order_id) )elementor/helpers/woo_checkout.php:75 -
PayM8 Gateway10+ installs
apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) )includes/class-wc-gateway-paym8.php:275 -
PAAY for WooCommerce10+ installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )lib/Paay/Gateway.php:101 -
StorzenFewer than 10 installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )elementor/widgets/class-storzen-style-thankyou-widgets.php:63 -
Custom Thank You WooFewer than 10 installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )custom-thank-you-woo.php:162 -
Platecraft Addons for ElementorFewer than 10 installs
apply_filters( 'woocommerce_thankyou_order_id', $id )includes/widgets/class-thank-you.php:307 -
OvebotFewer than 10 installs
apply_filters( 'woocommerce_thankyou_order_id', $order_id )includes/class-frontend.php:208
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.