WordPress filter hook
woocommerce_thankyou_order_key
Defined by WooCommerce and fired by 40 plugins in total, running on 10M+ sites between them.
“Filters the order key used to validate the order shown on the thanks page.”
How to use woocommerce_thankyou_order_key
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_key', function( $order_key ) {
// Change $order_key here.
return $order_key;
}, 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.
40 plugins that fire woocommerce_thankyou_order_key
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_key', ( empty( $_GET['key'] ) || ! is_string( $_GET['key'] ) ) ? '' : sanitize_text_field( wp_unslash( $_GET['key'] ) ) )includes/shortcodes/class-wc-shortcode-checkout.php:324 -
Essential Addons for Elementor1+ million installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( wp_unslash( $_GET['key'] ) ) )includes/Template/Woocommerce/Checkout/Woo_Checkout_Helper.php:77 -
WooPayments: Integrated WooCommerce Payments800,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( wp_unslash( $_GET['key'] ) ) )includes/class-wc-payments-order-success-page.php:422 -
GTM4WP700,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )src/Modules/WooCommerce/PageDataLayer.php:683 -
CartFlows200,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET[ $key_param ] ) ? '' : wc_clean( wp_unslash( $_GET[ $key_param ] ) ) )modules/thankyou/classes/class-cartflows-thankyou-markup.php:287 -
Mollie Payments for WooCommerce100,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty($_GET['key']) ? '' : wc_clean(filter_input(\INPUT_GET, 'key', \FILTER_SANITIZE_SPECIAL_CHARS)) )src/Gateway/MolliePaymentGatewayHandler.php:332 -
Snapchat for WooCommerce90,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )includes/Utils/Helper.php:109 -
AI Powered Marketing40,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )classes/class-helper.php:151 -
Kliken: Ads + Pixel for Meta30,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )classes/class-tracker.php:964 -
GTM Kit30,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( wp_unslash( $_GET['key'] ) ) )src/Integration/WooCommerce.php:525 -
UiChemy8,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $key )uichemy-composer/includes/admin/widgets/class-uichemy-woo-tags.php:443 -
LocalWeb All In One5,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )public/partials/lw-all-in-one-public-woocommerce-gtm.php:380 -
Tabby Checkout4,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $key )includes/functions.php:52 -
WowStore4,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )classes/Functions.php:237 -
Ultimate Store Kit3,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )includes/helper.php:1551 -
Responsive Addons for Elementor3,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( wp_unslash( $_GET['key'] ) ) )traits/responsive-addons-for-elementor-woo-checkout-helper.php:103 -
Custom Thank You Page for WooCommerce2,000+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )includes/class-wccty-order-resolver.php:59 -
워드프레스 결제 심플페이900+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET[ 'key' ] ) ? '' : pafw_get_unslash( $_GET, 'key' ) )pgall-for-woocommerce.php:335 -
PlatiOnline Payments700+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty($_GET['key']) ? '' : wc_clean($_GET['key']) )inc/core/class-wc-plationline-process.php:152 -
Tealium600+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) )tealium.php:241 -
NewsmanApp500+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )includes/remarketing/action/class-purchase.php:179 -
Rapyd Payment Extension for WooCommerce500+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty($_GET['key']) ? '' : wc_clean($_GET['key']) )includes/abstracts/abstract-wc-rapyd-payment-gateway.php:85 -
Fathom Analytics Conversions400+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) )admin/class-fathom-analytics-conversions-woocommerce.php:83 -
Noah Shop Builder for WooCommerce400+ installs
apply_filters( 'woocommerce_thankyou_order_key', $key )includes/Templates/Types/OrderReceived.php:193 -
Custom Thank You for WooCommerce300+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) )includes/class-ctyw-settings.php:170 -
Tapfiliate300+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty($_GET['key']) ? '' : wc_clean($_GET['key']) )woocommerce/tracking-code.php:27 -
LSX Customizer100+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) )classes/class-lsx-customizer-woocommerce.php:343 -
Custom Thank You Pages PRO for WooCommerce90+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) )wc-custom-thank-you-pages.php:117 -
Paiement par Carte DAHABIA et Carte CIB for WooCommerce70+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty($_GET['key']) ? '' : wp_unslash($_GET['key']) )paiement-par-carte-dahabia-et-cib-for-woocommerce.php:113 -
Beslist Tracking60+ installs
apply_filters( 'woocommerce_thankyou_order_key', $orderKey )src/WooCommerceWebhookHandler.php:432 -
2Checkout Dynamic Payment Gateway for WooCommerce40+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : woocommerce_clean( $_GET['key'] ) )gateway-2Checkout.php:103 -
Datalayer Tracking via DATA Reshape for WooCommerce20+ installs
apply_filters( 'woocommerce_thankyou_order_key', $this->get_query_arg_text( 'key' ) )includes/trait-frontend.php:231 -
Custom Thank you for Woo10+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) )index.php:115 -
Max Elements for Elementor10+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty($_GET['key']) ? '' : wc_clean(sanitize_text_field(wp_unslash($_GET['key']))) )elementor/helpers/woo_checkout.php:76 -
PayM8 Gateway10+ installs
apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( wp_unslash( $_GET['key'] ) ) )includes/class-wc-gateway-paym8.php:276 -
PAAY for WooCommerce10+ installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )lib/Paay/Gateway.php:102 -
StorzenFewer than 10 installs
apply_filters( 'woocommerce_thankyou_order_key', $key_raw )elementor/widgets/class-storzen-style-thankyou-widgets.php:65 -
eCheckpointFewer than 10 installs
apply_filters( 'woocommerce_thankyou_order_key', $key )echeckpoint_verification-prompt.php:354 -
Custom Thank You WooFewer than 10 installs
apply_filters( 'woocommerce_thankyou_order_key', $order_key )custom-thank-you-woo.php:169 -
Platecraft Addons for ElementorFewer than 10 installs
apply_filters( 'woocommerce_thankyou_order_key', is_string( $key ) ? sanitize_text_field( wp_unslash( $key ) ) : '' )includes/widgets/class-thank-you.php:309
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.