Remove search form from search results page I have a search box in a sidebar and I'm happy with it. I don't want Drupal to output another one on the results page. So far I've managed to remove it with the following code

function mythemename_preprocess_page(&amp;$variables) {
    if(array_key_exists('page', $variables)) {
        if(array_key_exists('content', $variables['page'])) {
            if(array_key_exists('system_main', $variables['page']['content'])) {
                if(array_key_exists('search_form', $variables['page']['content']['system_main'])) {
                    unset($variables['page']['content']['system_main']['search_form']);
                }
            }
        }
    }
}


but it doesn't look very clean to me. Is there another way?
Write a form alter:

function module_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if($form_id == "search_form") {
     $form['#type'] = 'hidden';
  }
}