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:

functions.php
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.

  1. WooCommerce icon WooCommerce7+ million installs do_action( 'woocommerce_before_shop_loop' ) includes/shortcodes/class-wc-shortcode-products.php:651
  2. Discount Rules for WooCommerce icon Discount Rules for WooCommerce100,000+ installs do_action( 'woocommerce_before_shop_loop' ) v2/App/Controllers/ShortCodeManager.php:380
  3. ShopEngine icon ShopEngine90,000+ installs do_action( 'woocommerce_before_shop_loop' ) widgets/archive-products/screens/default.php:414
  4. ShopLentor icon ShopLentor80,000+ installs do_action( 'woocommerce_before_shop_loop' ) woolentor-blocks/includes/classes/Product_Shortcode.php:271
  5. HUSKY icon HUSKY80,000+ installs do_action( 'woocommerce_before_shop_loop' ) index.php:2708
  6. Thim Elementor Kit icon Thim Elementor Kit20,000+ installs do_action( 'woocommerce_before_shop_loop' ) inc/elementor/widgets/archive-product/archive-product.php:250
  7. Genesis Connect for WooCommerce icon Genesis Connect for WooCommerce10,000+ installs do_action( 'woocommerce_before_shop_loop' ) lib/template-loader.php:268
  8. WCFM Marketplace icon WCFM Marketplace10,000+ installs do_action( 'woocommerce_before_shop_loop' ) views/store/wcfmmp-view-store-products.php:36
  9. ShopBuilder icon ShopBuilder10,000+ installs do_action( 'woocommerce_before_shop_loop' ) templates/elementor/archive/archive-product.php:41
  10. Discount Rules and Dynamic Pricing for WooCommerce icon Discount Rules and Dynamic Pricing for WooCommerce9,000+ installs do_action( 'woocommerce_before_shop_loop' ) public/partials/products-list/default.php:35
  11. Spexo Addons for Elementor icon Spexo Addons for Elementor6,000+ installs do_action( 'woocommerce_before_shop_loop' ) inc/widgets/woo-product-grid-classic.php:4568
  12. Themify Builder icon Themify Builder6,000+ installs do_action( 'woocommerce_before_shop_loop' ) themify/themify-template-tags.php:1479
  13. WowStore icon WowStore4,000+ installs do_action( 'woocommerce_before_shop_loop' ) addons/builder/templates/page.php:136
  14. WC Vendors icon WC Vendors3,000+ installs do_action( 'woocommerce_before_shop_loop' ) templates/front/vendor-shop.php:58
  15. ShopEngine Gutenberg WooCommerce Builder Blocks Addon icon ShopEngine Gutenberg WooCommerce Builder Blocks Addon3,000+ installs do_action( 'woocommerce_before_shop_loop' ) blocks/archive-products/screen.php:192
  16. The Pack Elementor addon icon The Pack Elementor addon2,000+ installs do_action( 'woocommerce_before_shop_loop' ) includes/widgets/woocommerce/woo-archive-product/view.php:6
  17. WP Crowdfunding icon WP Crowdfunding2,000+ installs do_action( 'woocommerce_before_shop_loop' ) wpcftemplate/woocommerce/basic/author-campaigns.php:72
  18. MDTF icon MDTF900+ installs do_action( 'woocommerce_before_shop_loop' ) classes/shortcodes.php:677
  19. MAS Elementor icon MAS Elementor800+ installs do_action( 'woocommerce_before_shop_loop' ) modules/woocommerce/classes/base-products-renderer.php:93
  20. Anant Addons for Elementor icon Anant Addons for Elementor700+ installs do_action( 'woocommerce_before_shop_loop' ) inc/widgets/woo/product-grid-with-nav.php:199
  21. StylePress for Elementor icon StylePress for Elementor600+ installs do_action( 'woocommerce_before_shop_loop' ) extensions/woocommerce/templates/archive-product.php:65
  22. ShopPress icon ShopPress600+ installs do_action( 'woocommerce_before_shop_loop' ) Templates/ProductShop.php:171
  23. Noah Shop Builder for WooCommerce icon Noah Shop Builder for WooCommerce400+ installs do_action( 'woocommerce_before_shop_loop' ) includes/Blocks/ArchiveProducts.php:187
  24. Shopready icon Shopready100+ installs do_action( 'woocommerce_before_shop_loop' ) src/extension/templates/tpl/archive-product.php:47
  25. WP Related Posts and Products (WRI) icon WP Related Posts and Products (WRI)100+ installs do_action( 'woocommerce_before_shop_loop' ) wri_template/template-wri-woocommerce-loop-shop.php:18
  26. Nexvio for WooCommerce icon Nexvio for WooCommerce50+ installs do_action( 'woocommerce_before_shop_loop' ) widgets/class-nexvio-product-grid-widget.php:668
  27. Products Slider for WPBakery icon Products Slider for WPBakery40+ installs do_action( 'woocommerce_before_shop_loop' ) widgets/widget-slider.php:273
  28. Productive Commerce icon Productive Commerce40+ installs do_action( 'woocommerce_before_shop_loop' ) includes/common/productiveminds-commerce-options.php:1409
  29. Nekto Core icon Nekto Core30+ installs do_action( 'woocommerce_before_shop_loop' ) woocommerce/archive-product.php:73
  30. WPEnhanced Ajax Filter Blocks icon WPEnhanced Ajax Filter Blocks20+ installs do_action( 'woocommerce_before_shop_loop' ) blocks/build/modules/archive-loop/render.php:3741
  31. TABLEiT icon TABLEiT20+ installs do_action( 'woocommerce_before_shop_loop' ) functions.php:2171
  32. Educat Elementor LMS Addon icon Educat Elementor LMS Addon20+ installs do_action( 'woocommerce_before_shop_loop' ) includes/widgets/woocommerce/woo-archive-product/view.php:6
  33. Comparis icon Comparis10+ installs do_action( 'woocommerce_before_shop_loop' ) templates/archive-product.php:70
  34. Luma Product Fields icon Luma Product Fields10+ installs do_action( 'woocommerce_before_shop_loop' ) templates/taxonomy-product-archive.php:152
  35. Product category and page relation icon Product category and page relation10+ installs do_action( 'woocommerce_before_shop_loop' ) woocommerce/archive-product.php:141
  36. Yay Wholesale B2B for WooCommerce icon Yay Wholesale B2B for WooCommerce10+ installs do_action( 'woocommerce_before_shop_loop' ) includes/Engine/Compatibles/Barn2WoocommerceProductTable/templates/product-table-shop.php:58
  37. Proshots For WooCommerce icon Proshots For WooCommerce10+ installs do_action( 'woocommerce_before_shop_loop' ) templates/archive-product.php:57
  38. Themofy Addons for Elementor icon Themofy Addons for Elementor10+ installs do_action( 'woocommerce_before_shop_loop' ) modules/woocommerce/includes/widgets/class-product-grid.php:880
  39. Fand Pickup Points : Ultimate Edition for WCFM icon Fand Pickup Points : Ultimate Edition for WCFM10+ installs do_action( 'woocommerce_before_shop_loop' ) views/single-branch/fandpipo-single-branch-right.php:39
  40. Trendmag Toolkit icon Trendmag Toolkit10+ installs do_action( 'woocommerce_before_shop_loop' ) inc/woocommerce.php:72
  41. Engage for WooCommerce icon Engage for WooCommerce10+ installs do_action( 'woocommerce_before_shop_loop' ) includes/shortcode.php:1064
  42. Yay Bulk Order for WooCommerce icon Yay Bulk Order for WooCommerceFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) includes/Engines/Compatibles/YayWholesale/templates/product-table-shop.php:58
  43. WEBD Woo Event Bookings icon WEBD Woo Event BookingsFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) templates/archive-product.php:93
  44. SpeedSearch icon SpeedSearchFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) src/class-html.php:877
  45. Tracking customers and product recommendations icon Tracking customers and product recommendationsFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) includes/shortcodes/shortcode-product-recommendations.php:38
  46. Mysterx icon MysterxFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) public/class-mysterx-shortcode.php:728
  47. MOC icon MOCFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) core/inc/segments-product.php:79
  48. Custom Customer Pricing for WooCommerce icon Custom Customer Pricing for WooCommerceFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) custom-customer-pricing-for-woocommerce.php:229
  49. Custom Shop Filter by Webnotics icon Custom Shop Filter by WebnoticsFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) public/shortcodes/archive-product.php:154
  50. Polanger Dating for WordPress icon Polanger Dating for WordPressFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) templates/integrations/woocommerce/archive-product.php:87
  51. Flx Modernize icon Flx ModernizeFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) includes/WooCommerce/CatalogPayloadBuilder.php:162
  52. Pickory Product Filter icon Pickory Product FilterFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) includes/rest/class-ppfx-fragment-renderer.php:115
  53. StratiSilo icon StratiSiloFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) includes/class-silo-theme-compat.php:186
  54. Bazario icon BazarioFewer than 10 installs do_action( 'woocommerce_before_shop_loop' ) elements/widgets/archive-products/archive-products.php:2732
  55. Sieve icon 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.