document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('form.elementor-search-form').forEach(function(f){ if(!f.querySelector('input[name="post_type"]')){ var i=document.createElement('input'); i.type='hidden'; i.name='post_type'; i.value='product'; f.appendChild(i); } }); });