Fix Divi WooCommerce Product Search Not Working

Fix Divi WooCommerce Product Search Not Working (Complete Step-by-Step Solution)

If you are using Divi with WooCommerce and your product search is not working, you are not alone.
Many Divi users face the same problem where the search page shows “No results found”, even though products exist.

In this guide, I will explain why this happens and show you the exact solution that fixes the Divi WooCommerce product search not working error

Why Divi WooCommerce Product Search Breaks

Divi’s Woo Products Module looks like the perfect tool for search pages, but there is a problem.

Divi does not pass the search query (?s=keyword) to the Woo Products Module.
This means:

  • The search runs correctly
  • WordPress finds the products
  • But Divi ignores the search results
  • The page shows empty products or “No results found”

This is a Divi limitation, not a WooCommerce bug.

Common Fixes That Do NOT Work

You may have already tried things like:

  • Adding post_type=product using JavaScript
  • Using the Woo Products Module inside the Search Results template
  • Modifying Divi search hooks
  • Using SQL or regex-based search filters

These methods either:

  • Break pagination
  • Stop working after updates
  • Or return empty results

The Correct and Reliable Solution

The only reliable way to fix this issue is:

  • Use Divi Theme Builder for the Search Results page
  • Replace the Woo Products Module with a custom PHP product query
  • Display products using WooCommerce’s own templates

This gives you:

  • A working product search
  • Full control over layout
  • Compatibility with Divi updates

Step 1: Create a Search Results Template in Divi

  1. Go to Divi → Theme Builder
  2. Click Add Template
  3. Select Manage Template Assignments and Select Search Results
  4. Click Edit Body and open the Divi Builder
Image 1
Fix Divi Woocommerce Product Search Not Working 3

This template will be used automatically when someone searches on your site.

Step 2: Add a Code Module

Inside the Search Results template:

  1. Add a Code Module
  2. This is where the search results will appear
  3. We will place a shortcode here in a later step

Do not use:

  • Woo Products Module
  • Blog Module
  • Shop Module

They will not work correctly for search.

Step 3: Add the PHP Code (Very Important)

You need to add the following code to your website.

Where to add this code

You can add this safely using:

  • Code Snippets plugin (recommended)
  • Or your child theme’s functions.php
Divi Woocommerce Product Search Not Working
Fix Divi Woocommerce Product Search Not Working 4

Complete Working PHP Code (3 Columns)

/**
 * Shortcode: [divi_search_products]
 * Displays WooCommerce products in a 3-column grid
 * Works with Divi Theme Builder search results
 */
function divi_search_products_shortcode() {

    $paged = max(1, get_query_var('paged', 1));

    // Get search keyword from URL (Divi compatible)
    $search_term = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : '';

    if (empty($search_term)) {
        return '<p>Please enter a search term.</p>';
    }

    $args = array(
        'post_type' => 'product',
        's' => $search_term,
        'posts_per_page' => 12,
        'paged' => $paged,
        'post_status' => 'publish',
    );

    $query = new WP_Query($args);

    ob_start();

    if ($query->have_posts()) {

        echo '<div class="custom-product-search">';
        echo '<ul class="products columns-3">';

        while ($query->have_posts()) {
            $query->the_post();
            wc_get_template_part('content', 'product');
        }

        echo '</ul>';
        echo '</div>';

        // Pagination
        if ($query->max_num_pages > 1) {
            echo '<div class="custom-product-pagination">';
            echo paginate_links(array(
                'current' => max(1, $paged),
                'total' => $query->max_num_pages,
                'prev_text' => '« Previous',
                'next_text' => 'Next »',
            ));
            echo '</div>';
        }

    } else {
        echo '<p>No products found for "<strong>' . esc_html($search_term) . '</strong>".</p>';
    }

    wp_reset_postdata();
    return ob_get_clean();
}
add_shortcode('divi_search_products', 'divi_search_products_shortcode');

Step 4: Use the Shortcode in Divi

Now go back to your Search Results template:

  1. Open the Code Module
  2. Add this shortcode:
[divi_search_products]
  1. Save the template

That’s it. Your product search is now working.

Too much complicated?

let me handle the hard parts so you don’t have to.


Prefer Fiverr? View my profile

Bonous:

How to Control the Product Grid Layout

In the code, this line controls the number of columns:

<ul class="products columns-3">

You can change it to:

  • columns-2 for 2 columns
  • columns-4 for 4 columns

Example:

<ul class="products columns-4">

WooCommerce will automatically adjust the layout.

What This Solution Fixes

This solution fixes:

  • Product search showing no results
  • Empty Woo Products Module on search pages
  • Pagination not working
  • Divi Theme Builder compatibility issues

It also:

  • Uses WooCommerce templates
  • Is safe for future updates
  • Does not rely on JavaScript hacks

Frequently Asked Questions

Can I use the Woo Products Module instead?

No. The Woo Products Module does not support search queries properly.

Does this work with Divi Theme Builder?

Yes. This solution is made specifically for Divi Theme Builder search templates.

Will this break after Divi updates?

No. It does not modify Divi core files or hooks.

Can I add category or tag filters?

Yes. This code can be extended to support categories, tags, and SKU search.

Final Thoughts

Divi is a powerful theme, but its WooCommerce search has limitations.
The method shown above is the cleanest and most reliable solution to fix product search issues.

If you are struggling with:

  • Divi
  • WooCommerce
  • Product filters
  • Search issues

Feel free to reach out and share your thoughts in the comment section. I’m always happy to help.

Other WordPress Tips

Table of Contents

Too much complicated?

let me handle the hard parts so you don’t have to.

Prefer Fiverr? View my profile

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

8 min read
Set up Redis object caching for WooCommerce safely. Learn what it improves, required page-cache exclusions,… Read More
8 min read
Fix the WordPress Site Health persistent object-cache warning safely. Learn when Redis helps, how to… Read More
12 min read
Connect OpenAI Codex to self-hosted WordPress using EMCP with tested setup, permissions, verification, troubleshooting, and… Read More
6 min read
Use this Elementor update checklist to verify backups, test staging, check compatibility, validate critical workflows,… Read More