• Pricing
  • Demo
  • Features
  • Get Started
  • Support
  • Docs
  • Account
  • Blog
  • Updates

CheckoutWC

  • Pricing
  • Demo
  • Features
  • Get Started

WooCommerce hooks: actions, filters, and checkout hooks explained

May 3, 2021 by Clifton Griffin in WooCommerce Tips
(Updated: November 16, 2026)

WooCommerce Hooks

Table of Contents

  • What are WooCommerce hooks?
  • Action hooks vs filter hooks
  • Where to put hook code
  • How to find the right WooCommerce hook
  • Common WooCommerce hooks
  • Example: add a description to the shop page
  • Example: add a note after the add to cart button
  • WooCommerce checkout hooks and CheckoutWC
  • Tips for working with hooks safely
  • Customize your checkout without code

WooCommerce hooks are points in the WooCommerce code where you can run your own function (an action) or change a value before it’s used (a filter), without editing plugin or theme files. You add a hook callback in a child theme’s functions.php or a code snippets plugin, pick the hook that fires where you want your change, and WooCommerce runs your code there.

What are WooCommerce hooks?

WooCommerce uses the same hook system as WordPress, so everything you know about add_action() and add_filter() applies. Because your code lives outside the plugin, WooCommerce updates don’t overwrite it, and you can move it between themes.

Action hooks vs filter hooks

  • Actions let you do something at a point, such as printing a notice under the add to cart button.
  • Filters let you change data passing through, such as the text on a button or the price shown.

The basic syntax is:

add_action( 'hook_name', 'your_function_name' );
add_filter( 'hook_name', 'your_function_name' );

Your function holds the code. A filter function receives the value, changes it, and must return it. For the full lists, see WooCommerce’s hook reference.

Where to put hook code

Use a child theme’s functions.php or a snippets plugin such as Code Snippets. A plugin keeps the code when you change themes, lets you switch a snippet off without editing files, and gives each snippet a name. Don’t edit WooCommerce’s template files directly; an update replaces your changes.

How to find the right WooCommerce hook

Open the template file that renders the page and read the do_action() calls. For the shop page, look in woocommerce/templates/archive-product.php. WooCommerce’s hook reference lists each hook with its location, and your theme may add its own.

Common WooCommerce hooks

PageHooks to know
Shop and productwoocommerce_before_main_content, woocommerce_archive_description, woocommerce_before_single_product_summary, woocommerce_single_product_summary, woocommerce_after_add_to_cart_form, woocommerce_product_meta_end
Cartwoocommerce_before_cart, woocommerce_cart_contents, woocommerce_cart_totals_after_order_total, woocommerce_proceed_to_checkout, woocommerce_after_cart
WooCommerce checkoutwoocommerce_before_checkout_form, woocommerce_checkout_before_customer_details, woocommerce_review_order_before_payment, woocommerce_review_order_after_submit, woocommerce_after_checkout_form, woocommerce_thankyou
My Accountwoocommerce_before_account_navigation, woocommerce_account_content, woocommerce_before_my_account, woocommerce_after_my_account
Mini cartwoocommerce_before_mini_cart, woocommerce_mini_cart_contents, woocommerce_widget_shopping_cart_buttons
Emailswoocommerce_email_header, woocommerce_email_before_order_table, woocommerce_email_order_details, woocommerce_email_footer

Hook names are lowercase, so copy them exactly.

Example: add a description to the shop page

WooCommerce doesn’t show a description under the shop page heading by default. This action adds one:

add_action( 'woocommerce_archive_description', 'my_shop_description' );
function my_shop_description() {
	if ( is_shop() ) {
		echo '<p>Welcome to our store! Browse our organic coffee beans and coffee gear.</p>';
	}
}

Example: add a note after the add to cart button

A note on shipping or returns near the button answers a common last-minute question:

add_action( 'woocommerce_after_add_to_cart_form', 'my_after_add_to_cart_note' );
function my_after_add_to_cart_note() {
	if ( is_product() ) {
		echo '<p>Free returns within 30 days.</p>';
	}
}

WooCommerce checkout hooks and CheckoutWC

The WooCommerce checkout hooks above fire on WooCommerce’s own checkout template. CheckoutWC replaces that template with its own, some of those hooks don’t fire on a CheckoutWC checkout, and others fire in different places. For CheckoutWC, use its own cfw_ hooks instead. CheckoutWC has several hundred, covering the checkout steps, fields, side cart, order bumps, and the thank you page, all listed in the CheckoutWC hooks reference. The visual hook guide shows where each fires on a real checkout. Hooks only fire on pages CheckoutWC renders.

For example, this adds a notice above the checkout steps:

add_action( 'cfw_checkout_main_container_start', function () {
	echo '<div class="woocommerce-info">Orders placed after 2pm ship the next working day.</div>';
}, 15 );

You can add PHP like this under CheckoutWC » Advanced » Scripts, in the PHP Snippets box. You often don’t need code at all: in the Checkout Editor, add a + New HTML block to a slot such as Before Express Checkout. See the Checkout Editor guide.

Tips for working with hooks safely

  • Test on a staging site first.
  • Prefix function names (my_, your brand) so they don’t clash with other code.
  • Use conditional checks such as is_product() so your output only appears where you want it.
  • Keep a note of each snippet’s purpose.
  • Re-test after WooCommerce or theme updates, because hook locations can change.

Customize your checkout without code

If your goal is a better checkout rather than a coding project, CheckoutWC gives you a visual Checkout Editor for fields, badges, and custom blocks, plus the cfw_ hooks when you need code. Plans start at $249 a year for one site.

The simplicity of Shopify with the power of WooCommerce. Replace your WooCommerce checkout page with CheckoutWC to boost sales and reduce cart abandonment.

Get Started
Previous Article

WooCommerce pricing: what a store costs

Next Article

CheckoutWC 5.0 Released

Clifton Griffin

WooCommerce is my patronus. Husband of Jennifer. Father of three. Believer.

Share this Post

Table of Contents

  • What are WooCommerce hooks?
  • Action hooks vs filter hooks
  • Where to put hook code
  • How to find the right WooCommerce hook
  • Common WooCommerce hooks
  • Example: add a description to the shop page
  • Example: add a note after the add to cart button
  • WooCommerce checkout hooks and CheckoutWC
  • Tips for working with hooks safely
  • Customize your checkout without code

The simplicity of Shopify with the power of WooCommerce. Replace your WooCommerce checkout page with CheckoutWC to boost sales and reduce cart abandonment.

Get Started

Supercharge your WooCommerce checkout

Stop losing sales at the final step. CheckoutWC is a drop-in upgrade that reduces abandoned checkouts and keeps customers happy.
Start Selling More
You won't regret it. We pinky swear.

Account

  • Account
  • Log In
  • Affiliate Program
  • Affiliate Agreement
  • Terms and Conditions and Refund Policy

Product

  • Features
  • Best WooCommerce checkout plugins compared
  • Flux Checkout vs CheckoutWC
  • CartFlows vs CheckoutWC
  • FunnelKit vs CheckoutWC
  • CheckoutWC Demos
  • Testimonials
  • Leave a Review

Support

  • Home
  • Documentation
  • Support
  • Contact
  • Need a Developer?

Our Good Friends

  • WP Sent Mail
  • Advanced Content Templates

Making the world a better place one WooCommerce checkout at a time and one support request at a time.

Made with by KestrelWP Icon Kestrel

Subscribe & Discount

Stay up to date and never miss a promotion, freebie, or update! Get a 10% OFF DISCOUNT for any premium plan for your first subscription year.

Copyright © 2026 CheckoutWC, All rights reserved.
CheckoutWC
Manage Consent

We use technologies like cookies to access or store device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting may adversely affect certain features and functions.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}
CheckoutWC
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}