Remove Search Box from Navigation Menu

The search function on every website should be found in the top-right corner of the website for usability purposes.

It serves as a shortcut for visitors to find what they're looking for, and is especially useful for poorly laid out, or poorly interlinked websites.

The search bar is like your navigation menu, cranked up to 11.

We do not recommend removing the search bar.

Note: None of these will remove the ability of a user to perform a search of your website by simply add "/?s=search text" to your address bar. Or by typing "site:feastdesignco.com search text" into a search engine.

Best

Don't do it.

Second-Best

Remove the search form from loading using the code snippets plugin and adding:

add_action( 'init', function() {
 remove_filter( 'wp_nav_menu_items', 'feast_primary_nav_menu_search', 12, 2 );
 } );

or, depending on your theme version, you may need to use alternative code:

add_action( 'init', function() {
remove_filter( 'wp_nav_menu_items', 'foodie_pro_primary_nav_menu_search', 12, 2 );
} );

Alternate

Simply hide it by applying the "display:none;" CSS property in your admin's "Additional CSS" panel:

#feast-search{display:none;}

For Foodie Pro v.4.4.0 and older:

#foodie-search{display:none;}

Worst

Do not edit theme's functions.php file, because changes you make there are lost during updates. You also run the risk of crashing your site. Use the code snippets method above.

Pre-3.1.6 Themes

Theme versions older than 3.1.6 will have the theme name in place of the feast function.

eg. feast_primary_nav_menu_search will be either:

  • foodie_pro_primary_nav_menu_search
  • cravings_pro_primary_nav_menu_search
  • seasoned_pro_primary_nav_menu_search