Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

woocomerce adjustment query

function shop_page_query_adjust( $query ) {

    $tax_query = (array) $query->get( 'tax_query' );

    $tax_query[] = array(
           'taxonomy' => 'product_cat',
           'field' => 'slug',
           'terms' => array( '' ), // Don't display products in the clothing category on the shop page.
           'operator' => 'NOT IN'
    );


    $query->set( 'tax_query', $tax_query );

    // WooCommerce Specific Product hide on Shop Page
    $posts = array(92,07,15,35);

	if (is_shop() && is_main_query()) {
		$query->set('post__not_in', $posts);
	}

}
add_action( 'woocommerce_product_query', 'shop_page_query_adjust' );