WordPress action hook
woocommerce_before_shop_loop
Defined by WooCommerce and fired by 55 plugins in total, running on 7.4M+ sites between them.
“Fire the standard shop hooks when paginating so we can display result counts etc. If the pagination is not enabled, this hook will not be fired.”
How to use woocommerce_before_shop_loop
It's an action: your callback runs at that point. Nothing needs to be returned.
Add this to your theme's functions.php or a small custom plugin:
add_action( 'woocommerce_before_shop_loop', function() {
// Your code runs here.
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
55 plugins that fire woocommerce_before_shop_loop
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
do_action( 'woocommerce_before_shop_loop' )includes/shortcodes/class-wc-shortcode-products.php:651 -
Discount Rules for WooCommerce100,000+ installs
do_action( 'woocommerce_before_shop_loop' )v2/App/Controllers/ShortCodeManager.php:380 -
ShopEngine90,000+ installs
do_action( 'woocommerce_before_shop_loop' )widgets/archive-products/screens/default.php:414 -
ShopLentor80,000+ installs
do_action( 'woocommerce_before_shop_loop' )woolentor-blocks/includes/classes/Product_Shortcode.php:271 -
HUSKY80,000+ installs
do_action( 'woocommerce_before_shop_loop' )index.php:2708 -
Thim Elementor Kit20,000+ installs
do_action( 'woocommerce_before_shop_loop' )inc/elementor/widgets/archive-product/archive-product.php:250 -
Genesis Connect for WooCommerce10,000+ installs
do_action( 'woocommerce_before_shop_loop' )lib/template-loader.php:268 -
WCFM Marketplace10,000+ installs
do_action( 'woocommerce_before_shop_loop' )views/store/wcfmmp-view-store-products.php:36 -
ShopBuilder10,000+ installs
do_action( 'woocommerce_before_shop_loop' )templates/elementor/archive/archive-product.php:41 -
Discount Rules and Dynamic Pricing for WooCommerce9,000+ installs
do_action( 'woocommerce_before_shop_loop' )public/partials/products-list/default.php:35 -
Spexo Addons for Elementor6,000+ installs
do_action( 'woocommerce_before_shop_loop' )inc/widgets/woo-product-grid-classic.php:4568 -
Themify Builder6,000+ installs
do_action( 'woocommerce_before_shop_loop' )themify/themify-template-tags.php:1479 -
WowStore4,000+ installs
do_action( 'woocommerce_before_shop_loop' )addons/builder/templates/page.php:136 -
WC Vendors3,000+ installs
do_action( 'woocommerce_before_shop_loop' )templates/front/vendor-shop.php:58 -
ShopEngine Gutenberg WooCommerce Builder Blocks Addon3,000+ installs
do_action( 'woocommerce_before_shop_loop' )blocks/archive-products/screen.php:192 -
The Pack Elementor addon2,000+ installs
do_action( 'woocommerce_before_shop_loop' )includes/widgets/woocommerce/woo-archive-product/view.php:6 -
WP Crowdfunding2,000+ installs
do_action( 'woocommerce_before_shop_loop' )wpcftemplate/woocommerce/basic/author-campaigns.php:72 -
MDTF900+ installs
do_action( 'woocommerce_before_shop_loop' )classes/shortcodes.php:677 -
MAS Elementor800+ installs
do_action( 'woocommerce_before_shop_loop' )modules/woocommerce/classes/base-products-renderer.php:93 -
Anant Addons for Elementor700+ installs
do_action( 'woocommerce_before_shop_loop' )inc/widgets/woo/product-grid-with-nav.php:199 -
StylePress for Elementor600+ installs
do_action( 'woocommerce_before_shop_loop' )extensions/woocommerce/templates/archive-product.php:65 -
ShopPress600+ installs
do_action( 'woocommerce_before_shop_loop' )Templates/ProductShop.php:171 -
Noah Shop Builder for WooCommerce400+ installs
do_action( 'woocommerce_before_shop_loop' )includes/Blocks/ArchiveProducts.php:187 -
Shopready100+ installs
do_action( 'woocommerce_before_shop_loop' )src/extension/templates/tpl/archive-product.php:47 -
WP Related Posts and Products (WRI)100+ installs
do_action( 'woocommerce_before_shop_loop' )wri_template/template-wri-woocommerce-loop-shop.php:18 -
Nexvio for WooCommerce50+ installs
do_action( 'woocommerce_before_shop_loop' )widgets/class-nexvio-product-grid-widget.php:668 -
Products Slider for WPBakery40+ installs
do_action( 'woocommerce_before_shop_loop' )widgets/widget-slider.php:273 -
Productive Commerce40+ installs
do_action( 'woocommerce_before_shop_loop' )includes/common/productiveminds-commerce-options.php:1409 -
Nekto Core30+ installs
do_action( 'woocommerce_before_shop_loop' )woocommerce/archive-product.php:73 -
WPEnhanced Ajax Filter Blocks20+ installs
do_action( 'woocommerce_before_shop_loop' )blocks/build/modules/archive-loop/render.php:3741 -
TABLEiT20+ installs
do_action( 'woocommerce_before_shop_loop' )functions.php:2171 -
Educat Elementor LMS Addon20+ installs
do_action( 'woocommerce_before_shop_loop' )includes/widgets/woocommerce/woo-archive-product/view.php:6 -
Comparis10+ installs
do_action( 'woocommerce_before_shop_loop' )templates/archive-product.php:70 -
Luma Product Fields10+ installs
do_action( 'woocommerce_before_shop_loop' )templates/taxonomy-product-archive.php:152 -
Product category and page relation10+ installs
do_action( 'woocommerce_before_shop_loop' )woocommerce/archive-product.php:141 -
Yay Wholesale B2B for WooCommerce10+ installs
do_action( 'woocommerce_before_shop_loop' )includes/Engine/Compatibles/Barn2WoocommerceProductTable/templates/product-table-shop.php:58 -
Proshots For WooCommerce10+ installs
do_action( 'woocommerce_before_shop_loop' )templates/archive-product.php:57 -
Themofy Addons for Elementor10+ installs
do_action( 'woocommerce_before_shop_loop' )modules/woocommerce/includes/widgets/class-product-grid.php:880 -
Fand Pickup Points : Ultimate Edition for WCFM10+ installs
do_action( 'woocommerce_before_shop_loop' )views/single-branch/fandpipo-single-branch-right.php:39 -
Trendmag Toolkit10+ installs
do_action( 'woocommerce_before_shop_loop' )inc/woocommerce.php:72 -
Engage for WooCommerce10+ installs
do_action( 'woocommerce_before_shop_loop' )includes/shortcode.php:1064 -
Yay Bulk Order for WooCommerceFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )includes/Engines/Compatibles/YayWholesale/templates/product-table-shop.php:58 -
WEBD Woo Event BookingsFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )templates/archive-product.php:93 -
SpeedSearchFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )src/class-html.php:877 -
Tracking customers and product recommendationsFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )includes/shortcodes/shortcode-product-recommendations.php:38 -
MysterxFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )public/class-mysterx-shortcode.php:728 -
MOCFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )core/inc/segments-product.php:79 -
Custom Customer Pricing for WooCommerceFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )custom-customer-pricing-for-woocommerce.php:229 -
Custom Shop Filter by WebnoticsFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )public/shortcodes/archive-product.php:154 -
Polanger Dating for WordPressFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )templates/integrations/woocommerce/archive-product.php:87 -
Flx ModernizeFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )includes/WooCommerce/CatalogPayloadBuilder.php:162 -
Pickory Product FilterFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )includes/rest/class-ppfx-fragment-renderer.php:115 -
StratiSiloFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )includes/class-silo-theme-compat.php:186 -
BazarioFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )elements/widgets/archive-products/archive-products.php:2732 -
SieveFewer than 10 installs
do_action( 'woocommerce_before_shop_loop' )src/Service/ResultsRenderer.php:74
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.