I can't get hook_form_alter or hook_form_FORM_ID_alter to add placeholder text to the search input
This is what eventually worked for me. Posting because other people seem to be having the same issue.

I placed this at the very end of the MyTheme.theme file.

/**
 * Add placeholder text to the search forms.
 */
function MyTheme_form_search_block_form_alter(&amp;$form,\Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $form['keys']['#attributes']['placeholder'] = t('Search this site...');
}


Hopefully this will be helpful for some.