Change "No Product" message in Woocommerce

10,172

Solution 1

Try the following, where you can customize the "No Product" message:

add_action( 'woocommerce_no_products_found', function(){
    remove_action( 'woocommerce_no_products_found', 'wc_no_products_found', 10 );

    // HERE change your message below
    $message = __( 'No products were found matching your selection.', 'woocommerce' );

    echo '<p class="woocommerce-info">' . $message .'</p>';
}, 9 );

Code goes in function.php file of your active child theme (or active theme). Tested and works.

Solution 2

Hi you could achieve this in two ways:

  1. overriding the no-products-foun2 template on your child theme (see: https://docs.woocommerce.com/document/template-structure/ - https://woocommerce.com/2015/12/site-search-nothing-found/)

  2. (easier) use "Say What" plugin - https://wordpress.org/plugins/say-what/ - It allows you to replace the desired string with the text you desire

With the second option, you can customize only the copy. Going with the first one, you have more freedom to insert pictures, a search form, etc...

Share:
10,172

Related videos on Youtube

SaeedHasani
Author by

SaeedHasani

Updated on June 04, 2022

Comments

  • SaeedHasani
    SaeedHasani almost 2 years

    I have the problem at the first Woocommerce page. I don't have any product at the shop. For this reason, Woocommerce shows "No Products" message on the first page. Now I want to change this message. How do I do this?

    enter image description here

    Shop address: http://shahroodantenna.ir/shop/

  • Zanam
    Zanam over 3 years
    Does this still work in 2021? I tried it but it doesn't.
  • LoicTheAztec
    LoicTheAztec over 3 years
    @Zanam Just tested that on WooCommerce last version and it still works perfectly… See this screenshot
  • Chad Reitsma
    Chad Reitsma over 2 years
    Why not just change the template? /templates/loop/no-products-found.php