Skip to main content
Login Join
Snippet · PHP

Add a Custom Message on the WooCommerce Shop Page

Shared by Amit Dholiya · September 14, 2026 · @woocommerce_before_shop_loop

6 views
1 upvote
Back to Snippets

Display a custom promotional message above the product listing on your WooCommerce Shop page.

Steps

  1. Add the code below to your theme’s functions.php.
  2. Change the message to your preferred text.
  3. Save and refresh the Shop page.
/**
 * Add custom message before WooCommerce shop products
 */
function custom_shop_page_message() {
    if ( is_shop() ) {
        echo '<div class="custom-shop-message">';
        echo 'Free shipping on orders over $50!';
        echo '</div>';
    }
}

add_action( 'woocommerce_before_shop_loop', 'custom_shop_page_message', 5 );
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments