Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets

WooCommerce shop page hooks allow developers to add, remove, or modify content at specific locations on the Shop page—without editing core WooCommerce files. Using these hooks, you can insert banners, labels, custom messages, product details, or promotional content exactly where you want them to appear. In earlier guides, we explored different WooCommerce cart page hooks & checkout page hooks.

In this post, we will learn about different WooCommerce Shop page hooks and where they are placed on the page. The examples below are tested with WooCommerce version 3.3 .

List of WooCommerce Shop page Hooks:

Hook Name
Position on Shop Page
woocommerce_before_main_content
Before the main shop content starts
woocommerce_archive_description
Below the Shop page title
woocommerce_before_shop_loopBefore the product loop starts
woocommerce_before_shop_loop_item
Before each product item
woocommerce_before_shop_loop_item_title
Above the product image
woocommerce_shop_loop_item_title
Above the product title
woocommerce_after_shop_loop_item_title
Below the product title
woocommerce_after_shop_loop_itemBefore the Add to Cart button
woocommerce_after_shop_loopAfter the product loop
woocommerce_after_main_contentAfter the main shop content

1. woocommerce_before_main_content

The woocommerce_before_main_content hook is placed at the start of the shop page. This hook is defined in the single-product.php template in woocommerce.

Let’s see an example to show a banner at the top to inform customers that there is a 10% discount on all the items in the shop.

It will look like this –

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

2. woocommerce_archive_description

The woocommerce_archive_description hook is placed after the ‘Shop’ header title on the shop page. This hook is defined in the archive-product.php template file in WooCommerce.

This hook defines itself. We can add some description about the shop page using it. Let’s take an example of a shop which sells TV sets. We will add some description like – ‘Shop from a wide selection of LED TVs..’ below the shop title.

WooCommerce Shop Page Hooks

3. woocommerce_before_shop_loop

The woocommerce_before_shop_loop hook is placed before the products list on the shop page. This hook is defined in the archive-product.php template file in WooCommerce.

For example, we will add a title before the products list called ‘New & Trending’.

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

Related Article: How to Show Product Description on the Shop Page in WooCommerce?

4. woocommerce_before_shop_loop_item

The woocommerce_before_shop_loop_item hook is placed on top of each product in the list. This hook is defined in the content-product.php template file in WooCommerce.

Whatever we define here will apply to all products in the list on the shop page. For example, lets add a tag of ‘New & Trending’ to all products.

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

If you want to add it to a single product, you can do so by adding a condition to check for the product ID.

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

5. woocommerce_before_shop_loop_item_title

The woocommerce_before_shop_loop_item_title hook is placed above the product image. This hook is defined in the content-product.php template file in WooCommerce.

Let’s add a tag of ‘Best Seller’ to some specific products with ID 57 & 59.

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

6. woocommerce_shop_loop_item_title

The woocommerce_shop_loop_item_title hook is placed above the product name. This hook is defined in the content-product.php template file in WooCommerce.

There can be many uses of this hook. Lets add the stock available for each product.

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

7. woocommerce_after_shop_loop_item_title

The woocommerce_after_shop_loop_item_title hook is placed below the product name. This hook is defined in the content-product.php template file in WooCommerce.

Lets display the product categories under the product name.

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

8. woocommerce_after_shop_loop_item

The woocommerce_after_shop_loop_item hook is placed above the ‘Add to Cart’ name. This hook is defined in the content-product.php template file in WooCommerce.

We will show our customers a few recommended products.

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

9. woocommerce_after_shop_loop

The woocommerce_after_shop_loop is placed just below the product list. This hook is defined in the archive-product.php template file in WooCommerce.

Let’s add a featured product at the bottom using this hook –

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

10. woocommerce_after_main_content

The woocommerce_after_main_content is placed after all the page content. This hook is defined in the single-product.php template file in WooCommerce.

You can add support related description and link to your support page here.

WooCommerce Shop Page Hooks: Visual Guide with Code Snippets - Tyche Softwares

Conclusion

WooCommerce shop page hooks give you full control over how content is displayed on your shop page—from banners and product labels to custom messages and recommendations. By using the right hook at the right position, you can customize the shop layout without editing core WooCommerce files. If you’re looking to extend this customization beyond the shop page, the next step is to explore how WooCommerce handles hooks on the cart page with practical examples.

Browse more in: WooCommerce Tutorials, Code Snippets, WooCommerce Guide, WooCommerce How Tos

Share It:

Subscribe
Notify of
14 Comments
Newest
Oldest
Inline Feedbacks
View all comments
John Pozadzides
1 year ago

I said it on one of the other posts as well, but like everyone else here, this is amazing! And super helpful. Much appreciated once again!!

Thanks. – John P.

vincent
5 years ago

Hi,
Thanks for this, really helpful, and examples are really the best to understand… this is exactly what I needed… almost… 😀

I have created a custom taxonomy for my products and I desperately try to make them appears just below the other taxonomy (category/tag) on the shop page (the one with all the products… I used the “add_action( ‘woocommerce_shop_loop_item_title’, ‘shop_loop_item_title’, 1 );” but it shows above the title…

Is there any way to put this string exactly where I want…

Thanks!
Vincent

5 years ago

When I put some text in the Shop page header using the woocommerce_archive_description snippet, it shows up on every page in the store that displays a category with multiple products. How can I restrict the text so that it appears ONLY on the Shop page?

Giovanni
6 years ago

Hello, I try those hook, but not all working. In my site, woocommerce_after_shop_loop_item and woocommerce_shop_loop_item_title doesn’t working. Instead, woocommerce_after_main_content works perfectly. Moreover, how is it possible to use more functions at the same time?

6 years ago

Great read.

I have issues with the new wordpress version, regarding this?

14
0
Would love your thoughts, please comment.x
()
x
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible.

Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

By using our site, you acknowledge that you have read and understood our Privacy Policy and Terms & Conditions.