• 00Days
  • 00Hours
  • 00Mins
  • 00Sec
40% Off

Use coupon code

Limited Offer!

Home > Docs > Smart Coupons for WooCommerce > How to Hide the Coupon Field in WooCommerce Cart and Checkout

How to Hide the Coupon Field in WooCommerce Cart and Checkout

Last updated on October 19, 2026

You can hide the coupon field on the WooCommerce cart page, the checkout page, or both, by adding a short PHP snippet to your site.

Before you start: Add the snippet with a code snippets plugin or a child theme. If you paste it into your theme’s functions.php, a theme update will remove it. See Add Code Snippets Using Third-Party Plugins.

Quick steps:

  1. Open the Theme File Editor.
  2. Open the functions.php file.
  3. Copy a snippet below.
  4. Paste it at the end of the file.
  5. Click Update File.

Step 1: Open the WordPress Theme Editor

From the WordPress Dashboard, navigate to Appearance > Theme Editor to open the WordPress Theme Editor screen.

Step 2: Open the functions.php File

You can see the list of files in your active theme folder on the Theme Editor screen. Please scroll down the list and click on the Theme Functions (functions.php) file to open it in the text editor screen.

Step 3: Copy the PHP code

Depending on which page you want to disable the coupon code field, copy either of the two PHP code snippets below.

PHP Code to Hide Coupon Field in WooCommerce Cart

PHP Code to Hide Coupon Field in WooCommerce Checkout

Step 4: Add the PHP code to functions.php

In the WordPress Theme Editor screen, scroll down to the bottom of the functions.php file and paste the code at the end to hide the coupon field on WooCommerce Checkout & Cart pages. Alternatively, you can use a third-party plugin to add the code snippet. To learn more, check out this article: Add Code Snippets Using Third-Party Plugins.

Step 5: Update code

Click on the Update file button to save the code.

Final Result: Before and After

  1. Cart Page
Cart page before and after adding the code snippet
Cart page before and after adding the code snippet
  1. Checkout page
Checkout page before and after adding the code snippet
Checkout page before and after adding the code snippet

You can hide the WooCommerce coupon field on the cart or checkout page by adding a small PHP snippet to your functions.php file. Use is_cart() to disable it on the cart page and is_checkout() for checkout. Always use a child theme or code snippets plugin to prevent losing changes during updates.