For those using jQuery, you can easily add a hidden post type to any search form when the page is loaded. Just add a hidden input that indicates what type of search to run, as in the following example, which I had to do for the DIVI search panel to search for products instead of a blog:
<script> jQuery('document').ready(function(e){ var productSearchSetting = '<input type="hidden" name="post_type" value="product" />'; </script>
You can adapt this to your own site by switching around the selector in the jQuery line, which defines diviSearchForm$ to whatever form (s) you want to target.
In addition, if you want to search for all types of messages, not just the product, change the value of product to any
source share