Home > Docs > Smart Coupons for WooCommerce > Hide Coupon Field in WooCommerce Checkout & Cart Pages

Hide Coupon Field in WooCommerce Checkout & Cart Pages

Last updated on August 26, 2025

This article shows a shortcut to hide coupon field in WooCommerce Checkout & Cart pages.

  1. Navigate to the Theme file editor.
  2. Access the function.php file.
  3. Copy the code snippet given below.
  4. Paste the code into the function.php file.
  5. Save changes.

Step 1: Access the WordPress theme file editor

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

Step 2: Open 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