DRUPAL 8 | Add Search form as block

Navigate to “Structure – Blocks layout”, find the region in where you want add the form, and click “place the block”.

From the popup select “Search Form”, and “Save Block”, now you can drag and drop the block for change position.

If you need to use form for search only in some custom post type,

  1. first follow this steps, next, navigate to ” Configuration – Search pages “, scroll on bottom of the page, select the search page that you have created before ( “this steps” before ),
  2. click on arrow on right of “Modify” button
  3. select “Set as default”
  4. “Save configuration”.

From now your form’ll search only inside the custom post type defined during the creation of that search page.