• Hi, I’m working on a site that uses the Advanced Woo Search plugin. And I’ve been able to hide from the store products that don’t have a thumbnail, since some are being imported by the clients inventory system that way.

    I did it using this code:

    add_action( 'woocommerce_product_query', 'hide_image_pre_get_posts_query' );
    function hide_image_pre_get_posts_query( $query ) {
        $query->set( 'meta_query', array( array(
          'key' => '_thumbnail_id',
          'value' => '0',
         'compare' => '>'
       )));
    }

    But they still show up on the search bar, so I’m wondering if there’s a way to also hide them from appearing in any search.

    Thanks in advance.

    The page I need help with: [log in to see the link]

  • The topic ‘Hide products without Thumnails from search’ is closed to new replies.