SNIPPET: Make Divi Search Products Only

If you want Divi to search ONLY products, you are in the right place. We know how frustrating it is that Divi does not search the products but searches everything. This is not great for your customers UX so the snippet below will solve this for you.

Add this code to Divi > Theme Options > Integration > Body. 

Once added, some code will by dynamically added which will make the search bar in the header and all the search modules search products only.

We hope this helps you and any questions please ask.

If using the theme builder and adding the search module, please exclude pages and posts as seen below

theme builder exclude post and pages

44 Comments

  1. How can I make this work so it brings up results by product category (from Woocommerce) please?

  2. Hi there… I added the same code on another site I built last year and worked great.

    But this time is not showing any product on a new site I’m building for a new client. I checked all the setups between both pages and look the same. Any help?

    This is the site: https://www.opticentroxpress.com/

    • It seems you are using the theme builder and the search module has the hidden fields to search posts. Our tutorial above was used before the theme builder so was only for the default header.

      I will check this and see if we can update for the theme builder too

    • I have updated the article – please check

      • Hi, there… thank you for the update.

        Still no results. I’m gonna hide the search bar meanwhile.

        • oh ok. If you want me to check, please show it so I can check your website

          • Hi, same problem here.. It does not work with search module, in my case it adds “&et_pb_searchform_submit=et_search_proccess” to URL and it loses its functionality 🙁

            Results page URL is: mydomain.com/?s=xsearchtermx&et_pb_searchform_submit=et_search_proccess&post_type=product

            Any possible solution?

  3. Worked perfectly to get the default search to search only Woo products! Thanks!

    • Thank you so much!

  4. Great, but how do we make this search Products Titles and Product Categories Only

    • This would require more custom code – sorry.

      There are plugins like relevanssi that could possibly help

  5. hello, do i need a plugin from you guys to use the code?

    • No, this will work with default Divi + Woo

  6. Thanks for the code! Seems to work for a side bar search but not for my divi search in the header. I am using the theme builder for my header. Could this be an issue?

    • Not sure, should work – can you send a link to your site so I can see?

  7. Is there a way to sort the search by ” Price high to low”?

    Love this code.

    Good Job

    • You could but not related to this tutorial – sorry. If you are using our plugin BodyCommerce you can make it sort by this, so when they search it will be like this

    • Great thank you!

  8. sadly it does not work…

  9. Does this code still work? I’ve tried it on a new Divi/Woo site without success.

    It’s just what I need, especially if it can cause the search box to search SKU values.

    • Yes it still works – I actually did this on a customers site the other day.

      Send me a link to your site so I can see?

  10. Hugely appreciated this! I did add some additional code so people knew the search fields were meant for searching products. Changed the placeholder text to “Search product …” Check it out at Lous Barber Supply.

    • Nice! So glad it helped you

  11. Thank you so much, it worked perfectly for my site. Is there any chance to change the results display from 5 products to lets say 16 products?

    • You can change this in Divi > Theme Options 😀

    • No, you can use our plugin Divi BodyCommerce to help you if you want to do this

  12. Hi, i don’t see the snippet!! could you send me please?

  13. It dint work for me either.
    any ideas, what must have gone wrong?

    • Not sure – please check the other comment about the Divi search module

  14. This is not working for me.. I have ensured to add the code snipped to the body but still nothing. Any advice?

  15. Very cool indeed, works well! Thank you.

    • Pleasure, glad it worked

  16. This worked extremely well and was exactly what I needed. Thank you! Anychance we can add to this and make the code also consider product tags as well? Again, thanks for the fantastic work.

      • Hi, thank you for your content. If I instaled relevanssi, will it work with divi search module? I tried once before finding this post but nothing changed.

        • I have personally used this plugin and worked well for me

  17. This is amazing – just what I was looking for, and it works like a treat! Thank you so much.

    • Perfect thanks – glad it helped you 😀

  18. Hi… This did not work form me

    Any ideas on what is wrong??
    For the moment I have disabled the Divi Search and I´m Currently using AWS, but it displays on-screen and doesn’t send to the Search Result Page Created and Asigned in Divi.

    Cheers,

    • Maybe there is a javascript error on your website which makes this code not run.

      Can you send me a link to your site with Divi Search enabled (you can use CSS to hide it if you want) – I need to see if the hidden input gets added

Submit a Comment

Explore more from Divi Engine

Divi Form Builder

Divi Form Builder

From simple contact forms to complex frontend post or product creation, Divi Form Builder has you covered.

Divi Form Builder
Find out more
Divi Machine

Divi Machine

Build complex websites that displays dynamic fields you can filter, search and so much more with the Divi Builder.

Divi Machine
Find out more
Divi BodyCommerce

Divi BodyCommerce

A versatile toolkit for developers using Divi and WooCommerce together, designed to boost your e-commerce site and achieve greater conversion rates.

Divi BodyCommerce
Find out more
Divi Handoff

Divi Handoff

Let clients update content without touching the Divi Builder. Design layouts once, connect them to Flexible Content fields, and give editors simple forms for text, images, and sections.

Divi Handoff
Find out more
Divi Loop Extender

Divi Loop Extender

Unlock the Full Power of Divi 5 Loop Builder Add advanced sorting, filtering, and relationship logic right inside the Visual Builder.

Divi Loop Extender
Find out more
Divi Membership

Divi Membership

Monetize your Divi websites by transforming them into membership sites with seamless subscription management, user-friendly interfaces, and customizable membership tiers.

Divi Membership
Find out more
Divi Machine Accounts

Divi Machine Accounts

Build an account area for your customers to edit their details, access wishlist, submitted posts and more. *Note: Requires Divi Machine installed and active

Divi Machine Accounts
Find out more
Divi Ajax Filter

Divi Ajax Filter

Filter WooCommerce, Posts & Custom Posts without reloading the page.

Divi Ajax Filter
Find out more
Divi Mobile

Divi Mobile

Divi Mobile helps you create beautiful looking mobile menus without having to code.

Divi Mobile
Find out more
Divi Nitro

Divi Nitro

Give your Divi website that extra boost of speed with our Divi Nitro plugin to enhance your customer's experience.

Divi Nitro
Find out more
Divi Protect

Divi Protect

Password protect the content of your Divi website with our Divi Protect plugin. Keep unwanted eyes out!

Divi Protect
Find out more
Divi Mega Menu

Divi Mega Menu

Create stunning, responsive, and content-rich mega menus using the Divi Builder you already know. No coding required.    

Divi Mega Menu
Find out more