woocommerce_before_shop_loop

WooCommerce runs the woocommerce_before_shop_loop action before the product grid in a classic shop or product-category archive. It takes no arguments and only runs when the archive has a product loop. The default callbacks show WooCommerce notices at priority 10, the result count at 20, and the sorting control at 30.

TypeAction hook
LocationClassic shop and product archives, before the product loop
ArgumentsNone
SourceWooCommerce archive template

Add a note above the shop grid

add_action( 'woocommerce_before_shop_loop', function () {
    if ( ! is_shop() ) {
        return;
    }

    echo '<p class="shop-note">' .
        esc_html( 'Browse our latest products below.' ) .
        '</p>';
}, 25 );

This places the message after the result count and before the sorting control on the main shop page. The is_shop() check excludes product-category archives; remove that condition if the message should appear on every applicable archive. Put the callback in a site-specific plugin or a child theme, then check the spacing around the sorting controls at desktop and mobile widths.

An empty shop does not reach this action in the classic archive template. Use woocommerce_no_products_found for empty-result messages instead. As with any hook, plugins or themes can move or remove the default callbacks, changing where priority 25 appears.

Block archive compatibility

WooCommerce has an archive-template compatibility layer that can run classic hooks in some block-based product archives. The hook's placement and surrounding controls may differ from the PHP template, so verify the rendered archive before relying on its position. The WooCommerce compatibility code provides implementation details.