I'm able to limit the search to one post type which works like a charm.

This code works: <input type="hidden" name="post_type" value="videos"/>

However, how do I limit the search to be performed in 4 custom post types instead of just one.

The post types are "videos, e-courses, e-books and white-papers".

Any help is really appreciated.


1 Answer 1


You have to change the input with 4 inputs like this :

<input type="hidden" name="post_type[]" value="videos" />
<input type="hidden" name="post_type[]" value="e-courses" />
<input type="hidden" name="post_type[]" value="e-books" />
<input type="hidden" name="post_type[]" value="white-papers" />

You may get more detail about a complete code in this article

  • Curious use of form inputs to set an array of options... Commented Jun 28, 2020 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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