Here are a few fixes to solve the “Woocommerce search not working issue” without getting into coding. Search is a key feature in any Woocommerce store and failing to return the correct results can lead to losing out on conversions.

Common forms of issues with Woocommerce search

woocommerce search not working
  • Woocommerce search function not working
  • Woocommerce search results don’t show products.
  • Woocommerce product search in admin is not working.
  • Woocommerce search products by title, category, tag, or brand are not working.
  • Woocomerce admin product search not working.

Fix Woocommerce search not working with WP Fastest Site search

WP Fastest Site Search

Fixing your woocommerce search not working issue with the WP Fastest site search is one of the quickest ways. Just install the extension from the above link and once you create your search index from the dashboard, your default woocommerce search will be replaced with a beautiful new search engine similar to the image below. woocommerce search not working


Some simple fixes for WooCommerce search issues

  1. Upgrade to the latest version of WordPress from your WordPress admin panel.
  2. Upgrade woocommerce database.
  3. Upgrade your Woocomerce plugin to the latest version.
  4. If you have any caching plugins, delete the cache and try searching again.
  5. Usually, themes such as the Sydney, Revo themes could conflict with Woocommerce. Change your theme to a default WordPress theme like Twenty nineteen.
  6. Uninstall plugins and check compatibility with your Woocommerce search by enabling one plugin at a time.

Quick fixes by tweaking code-

  1. Woocommerce search results don’t show products– By default WordPress searches only blogs and pages without searching your Woocommerce products. To do this, replace your search form.
    <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
        <label for="s">Search</label>
        <input type="text" class="field" name="s" id="s" placeholder="Search Something" />
        <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search" />
        <input type="hidden" name="post_type" id="post_type" value="product"  />
  2. Woocommerce product search in admin is not working.Woocommerce product search in admin is not working. To fix this issue, disable the Yoast SEO plugin and add the following code to the functions.php file.
    add_action( 'pre_get_posts', 'products_pre_get_posts' );
    function products_pre_get_posts( $query ) {
         $query->set( 'tax_query', array(
                'taxonomy'  => 'product_cat',
                'field'     => 'term_id',
                'terms'     => get_terms( array( 'taxonomy' => 'product_cat', 'fields' => 'ids' ) )

    If it is still not working, add the following code to your functions.php file.

    function m_request_query( $query_vars ) {
        global $typenow;
        global $wpdb;
        global $pagenow;
        if ( 'product' === $typenow && isset( $_GET['s'] ) && 'edit.php' === $pagenow ) {
            $search_term  = esc_sql( sanitize_text_field( $_GET['s'] ) );
        // Split the search term by comma.
            $search_terms = explode( ',', $search_term );
        // If there are more terms make sure we also search for the whole thing, maybe it's not a list of terms.
            if ( count( $search_terms ) > 1 ) {
                $search_terms[] = $search_term;
        // Cleanup the array manually to avoid issues with quote escaping.
            array_walk( $search_terms, 'trim' );
            array_walk( $search_terms, 'esc_sql' );
            $meta_key               = '_sku';
            $post_types             = array( 'product', 'product_variation' );
            $query                  = "SELECT DISTINCT posts.ID as product_id, posts.post_parent as parent_id FROM {$wpdb->posts} posts LEFT JOIN {$wpdb->postmeta} AS postmeta ON posts.ID = postmeta.post_id WHERE postmeta.meta_key = '{$meta_key}' AND postmeta.meta_value IN  ('" . implode( "','", $search_terms ) . "') AND posts.post_type IN ('" . implode( "','", $post_types ) . "') ORDER BY posts.post_parent ASC, posts.post_title ASC";
            $search_results         = $wpdb->get_results( $query );
            $product_ids            = wp_parse_id_list( array_merge( wp_list_pluck( $search_results, 'product_id' ), wp_list_pluck( $search_results, 'parent_id' ) ) );
            $query_vars['post__in'] = array_merge( $product_ids, $query_vars['post__in'] );
        return $query_vars;
    add_filter( 'request', 'm_request_query', 20 );


  3. Woocommerce search products by title, category, tag, or brand are not working– To fix this issue, apart of WooCommerce search not working, install the free products filter for Woocommerce plugin. It enables product filtering by –
    • products categories,
    • products attributes,
    • products tags,
    • products custom taxonomies
    • products price.product filter plugin woocommerce
  4. Plugin conflicts- If you have a lot of plugins, you can try to uninstall a few and

Create your own Woocommerce custom search engine and add it to your website

  1. Sign up at Woocommerce search engine.
  2. Choose your nearest data center.
  3. Enter your product sitemap URL.
  4. Now the search engine crawler will begin crawling your website.
  5. Go to Crawl-> what to crawl-> SitemapCrawl-> what to crawl-> Sitemap and remove unnecessary sitemap URLs. Also, enable crawl only sitemap.
  6. Go to Install-> code and copy-paste the code to the head section of your woo-commerce website.
  7. You can now replace your existing Woocommerce search form with this.woocommerce search not working

Get ExpertRec Plugin

muthali ganesh

Muthali loves writing about emerging technologies and easy solutions for complex tech issues. You can reach out to him through chat or by raising a support ticket on the left hand side of the page.

You may also like