Coupons: the good, the bad and the ugly. WooCommerce coupon codes are great to convert more sales – but sometimes they get users to pause / stop placing the order until they find a coupon code online (you did it too, I know).
One good workaround that the internet giants such as Amazon and eBay have implemented is to hide the coupon form until an email is entered, or alternatively to move the coupon code to the bottom of the Checkout page. This is a very smart move, and gets the user to concentrate on the Cart / Checkout details before entering or searching for a coupon.
So the question is – how to remove the coupon form in the Cart page (legacy/classic) and how to move the same to the bottom of the Checkout page (legacy/classic)? Well, as usual, a bit of PHP can help us. Here’s how it’s done!

PHP Snippet 1: Remove Coupon Form @ WooCommerce Cart Page Only
This snippet disables coupon usage only on the WooCommerce Cart page, while keeping them active elsewhereโi.e. the Checkout page.
The woocommerce_coupons_enabled filter determines whether coupons are allowed, and the custom function bbloomer_disable_coupons_cart_page() checks if the current page is the Cart. If it is, the function returns false, hiding the coupon form and preventing coupon input there.
For all other pages, including the Checkout page, it returns true, allowing coupon codes to be used as normal. This is useful when you want to simplify the Cart page or encourage coupon entry later in the purchase flow.
/**
* @snippet Remove Coupon Form @ WooCommerce Cart
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 10
* @community https://businessbloomer.com/club/
*/
add_filter( 'woocommerce_coupons_enabled', 'bbloomer_disable_coupons_cart_page' );
function bbloomer_disable_coupons_cart_page() {
if ( is_cart() ) return false;
return true;
}
PHP Snippet 2: Remove Coupon Form @ WooCommerce Checkout Page Only
This snippet removes the default WooCommerce coupon form from its usual position above the legacy/classic checkout form.
By calling remove_action on the woocommerce_before_checkout_form hook, it detaches the woocommerce_checkout_coupon_form function, which normally displays the โHave a coupon?โ toggle and input field. The priority 10 ensures the correct instance of that function is removed.
This doesnโt disable couponsโit only hides the form from that specific location. You can still enter coupon codes from the Cart page, for example.
/**
* @snippet Remove Coupon Form @ WooCommerce Checkout
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 10
* @community https://businessbloomer.com/club/
*/
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
PHP Snippet 3: Move Coupon Form @ WooCommerce Checkout Page
This pair of snippets moves the default WooCommerce coupon form from the top of the checkout page to the bottom.
The first part removes the form by detaching woocommerce_checkout_coupon_form from the woocommerce_before_checkout_form hook, which is where WooCommerce displays the โHave a coupon?โ section by default. The second part re-adds that same function to the woocommerce_after_checkout_form hook, effectively repositioning the coupon field below the entire checkout form.
This approach is ideal when you want to simplify the top of the checkout and make coupons less distracting while still keeping them fully functional.
/**
* @snippet Remove Coupon Form @ WooCommerce Checkout (Top)
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 10
* @community https://businessbloomer.com/club/
*/
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
/**
* @snippet Re-add Coupon Form @ WooCommerce Checkout (Bottom)
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 10
* @community https://businessbloomer.com/club/
*/
add_action( 'woocommerce_after_checkout_form', 'woocommerce_checkout_coupon_form', 10 );









This customization makes the page reload instead of only doing ajax refresh. Is it possible to disable the page reload?
Nico, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
A quick solution not needing code is to hide the coupon field through the WooCommerce settings.
In the backend: Go to WooCommerce -> Settings -> General and uncheck “Enable coupons”.
It hides the field from the Cart and Checkout pages.
Thanks Paal!
Hi, I’ve found this solution (it’s not my code), looks like it work good, what do you think?:
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 ); add_action( 'woocommerce_review_order_after_order_total', 'woocommerce_checkout_coupon_form_custom' ); function woocommerce_checkout_coupon_form_custom() { echo '<tr class="coupon-form"><td colspan="2">'; wc_get_template( 'checkout/form-coupon.php', array( 'checkout' => WC()->checkout(), ) ); echo '</tr></td>'; }If it works for you, it works for us!
I adjusted the code a little in order to hide the coupon box on the cart & checkout if there are no published coupons:
// Hide Coupon Field on Cart if no Published Coupons function bse_disable_coupon_field_on_cart( $enabled ) { $count_posts = wp_count_posts( 'shop_coupon' )->publish; if ( is_cart() && $count_posts == '0' ) { $enabled = false; } return $enabled; } add_filter( 'woocommerce_coupons_enabled', 'bse_disable_coupon_field_on_cart' ); // Hide Coupon Field on Checkout if no Published Coupons function bse_disable_coupon_field_on_checkout( $enabled ) { $count_posts = wp_count_posts( 'shop_coupon' )->publish; if ( is_checkout() && $count_posts == '0' ) { $enabled = false; } return $enabled; } add_filter( 'woocommerce_coupons_enabled', 'bse_disable_coupon_field_on_checkout' );Nice
Hi Rodolfo
I added the move coupon to the cart, and the hide coupon in the checkout and both worked great.
As always, thank you very much!!!
Great!
Regarding hiding it from the cart page, I successfully used the snippet from here:
https://www.tychesoftwares.com/how-to-hide-the-woocommerce-coupon-code-field/
Are there any pitfalls to this? Should I be hiding via CSS instead?
Thank you so much for this website and sharing your knowledge. It’s much appreciated, Rodolfo!
Hi Jodi, if you wish to “move” it, then you can’t use that function because it hides from anywhere in the Cart. If you wish to completely remove it, then yes, that’s ok
Okay, thank you. I think this is okay for now because I’m using discounts that are automatically applied. If I ever have the need to enter a coupon code, hopefully I remember how I hid it ๐
Nice!
Hi Rodolfo,
I tried to apply your code in my WooCommerce check out & cart page but came in to some issue:
1. in the cart page i see the “coupon code” field twice
2. I managed to hide the “Have a coupon code” line but i didn’t succeed to move it to the payment area
Any idea why?
Thanks,
Gabriel
Could be due to your custom theme. Can you try with Storefront for a moment?
Hi there, Afraid none of the snippets didn’t work on my woocommerce. Maybe this is because of the latest updates or so. I’me newbie to this and look for relocating the coupon form. Any other suggestions?
Where did you place them?
I use the snppet to remove the “Have a coupon” field from the cart page and it worked. I added it to the additional CSS space and it worked. Thanks for this. It saves me a lot of stress.
Cool
If you use this technique you will lose the error message to apply a promo code if someone blankly hits the apply code button. You will need to write a fix for that depending on how you use this.
Ok thank you Stef
Worked like a charm.
Your website has been very resourceful in helping me make some checkout page tweaks.
Thanks Rod,
Thanks Gil!
Is it possible to make it disappear only for a specific product?
Yes, of course
Thank you so much. It worked! from Japan.
Arigato!
Hello, Rodolfo Is there a way to make coupon form work and update with ajax on any other places but cart or checkout page (for example, within off-canvas shopping cart)? I’ve added the form to my cart panel widget by pasting part of your code … so applying the coupons works well, but it redirects me to the cart page immediately. How your snippet can be adapted to work without redirecting and refreshing a page?
Yaroslav, thanks so much for your comment! Yes, this is possible – unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R
Hi, i believe this will sort out the Ajax bit. It does require some modifying but what this does is bring the scripts that are used on the checkout, onto the cart page.
All credit to the respective owner on stack overflow : https://stackoverflow.com/questions/46736095/move-the-coupon-field-to-the-cart-totals?rq=1
Add this to the cart totals where you want the coupon to go
// Add the checkout scripts to cart in order for Ajax to work function enqueue_woo_scripts() { if( is_cart() ) { if( ! wp_script_is( 'wc-checkout', 'enqueued' ) ) wp_enqueue_script( 'wc-checkout' ); } } add_action( 'wp_enqueue_scripts', 'enqueue_woo_scripts' );NICE! Thank you
If the coupon form is removed from Checkout, it’s possible that some users will never see the coupon form.
That’s because in Storefront, hovering over the shopping cart icon displays a menu with two options: View cart or Checkout. If user chooses Checkout, will not see the Shopping Cart page. If that’s the only place where the coupon form appears, a user trying to enter a coupon code will be frustrated.
Good point David ๐ You could force people to pass through the Cart first or find another workaround, anyway this snippet applies only to some businesses while some others won’t need this. Thank you
These snippets worked fine for us and really improved both our cart and checkout pages, keeping users focused on making their purchases rather than trying to find out where they might find discount codes. We only use discount codes for a handful of items and we let people know if they’re eligible for discounts. We only needed a small amount of our own styling and added a piece of text above the coupon box to say ‘If you have been provided a coupon code, please enter it before proceeding to checkout:’. Thank you, we always review your write-ups for helpful tips and appreciate the time you put into them.
Thanks so much Kim ๐
Hello Rodolfo,
I think this action should work fine to move coupon field
remove_action( ‘woocommerce_before_checkout_form’, ‘woocommerce_checkout_coupon_form’, 10 );
REMARK: Thereโs only one other place to re-add it: below the entire checkout form. This is because it canโt be nested inside of the checkout form without affecting the โPlace Orderโ button. You could add it at the end of the form if desired by then adding this snippet:
add_action( ‘woocommerce_after_checkout_form’, ‘woocommerce_checkout_coupon_form’ );
Hello Fabio ๐ Doesn’t that break the coupon code form JS? I tried in different positions but would have had to revise the WooCommerce JS to also make it work – hence why I just decided to remove it
Hi,
Why don’t use jQuery to move the form?
$( “#checkout_coupon” ).insertAfter( “.where_you_want” );