You can use the action
attribute of the form to search certain areas of your site. If your reading settings have separate front & post pages, you can set the action
to the URL of the posts’ page to search only the blog:
<form action="<?php echo esc_url( get_post_type_archive_link( 'post' ) ) ?>">
Alternatively, you can use hidden form inputs to set other query parameters like post_type
, and then just use the site URL for the form action.