WooCommerce search products by tag or description Query Posts
<p>I want to write the custom query to search product by its description. By default the WooCommerce search doesn't include the searching by description. I am using the <code>query_posts</code> function to get products. Here is my code:</p>

<pre><code>$args = array(
    's'                   =&gt; $search_keyword,
    'post_type'           =&gt; 'product',
    'post_status'         =&gt; 'publish',
    'ignore_sticky_posts' =&gt; 1,
    'meta_query'          =&gt; array(
       array(
        'key'     =&gt; '_visibility',
        'value'   =&gt; array( 'search', 'visible' ),
        'compare' =&gt; 'IN'
        )
      )
   );
$products = get_posts( $args );
</code></pre>