WooCommerce Hooks in Brief: Add and Remove a Checkout Action

Quick Summary
- Hook a callback to woocommerce_checkout_before_order_review with add_action() to print notices, trust badges or other HTML above the checkout order summary.
- remove_action() needs the same hook, function name and priority, and must run after the callback is added, for example on init or wp.
- The checkout action hooks only run on the classic [woocommerce_checkout] shortcode checkout, not the block-based Checkout.
WooCommerce fires action hooks throughout the checkout page, so you can add content without editing template files. woocommerce_checkout_before_order_review runs just before the order review section, which holds the order summary table and the payment options. Use it to print a notice, trust badges or any other HTML above the order summary.
These hooks belong to the classic checkout (the [woocommerce_checkout] shortcode); the block-based Checkout doesn’t run them. Add the code to your child theme’s functions.php or a plugin.
Add a callback
Replace the comment inside the function with your own output, for example an echo with your HTML.
// define the woocommerce_checkout_before_order_review callback
function action_woocommerce_checkout_before_order_review( ) {
// make action magic happen here...
};
// add the action
add_action( 'woocommerce_checkout_before_order_review', 'action_woocommerce_checkout_before_order_review', 10, 0 );10is the priority; when several functions use the same hook, lower numbers run first.0is the number of arguments passed to your function. This hook doesn’t pass any.- Give the function a unique name with your own prefix to avoid conflicts.
Remove a callback
To unhook a function, call remove_action() with the same hook name, function name and priority you used to add it.
// remove the action
remove_action( 'woocommerce_checkout_before_order_review', 'action_woocommerce_checkout_before_order_review', 10, 0 );- The priority must match, or nothing happens.
remove_action()doesn’t take an argument count, so the final0is ignored. remove_action()only works once the matchingadd_action()has run. If a plugin or parent theme adds it, run your removal on a hook that fires after that, such asinitorwp.
Hooks like these are how I customize a store without editing WooCommerce’s own files; see my WooCommerce development services.
Related articles
- moving the coupon form above the order table: a jQuery and CSS change to the same part of the checkout
- product thumbnails in the checkout order review: filters that change the order review table itself
- changing the Order notes label and placeholder: a checkout filter that changes a value instead of adding output

