Search results link for the post : https://domain.com/?s=item+item

I want when clicking search, the article search link automatically redirects to the product woocommerce search link is: https://domain.com/?s=item+item&post_type=product

We hope you help, thank you !!!


I think, you just need to add below code on above the submit button code in searchform.php file.

<input type="hidden" name="post_type" value="product" />
  • 1
    Thank you verry much, The code works perfectly! (@ _ @) – Phạm Anh Tú Feb 10 '20 at 4:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.