Fatal error: Cannot redeclare add_search_to_wp_menu()

Avatar
  • Answered
Hi
Wanted to remove the search bar from themes-functions.php
Now there's a white screen saying
Fatal error: Cannot redeclare add_search_to_wp_menu()
How do I remove the search bar and gain acces to my site again?
Niklas
Avatar
IMH Support Agent 5
Hello, Thank you for contacting us about this search bar error. I recommend replacing the code in the theme-functions.php file with the code from a backup. If you don't have a backup you can likely grab clean code from the theme files you originally downloaded. If you still can't get access to your site with the theme you have edited, you can always switch your theme. Without access to your WordPress admin area, you can change the theme in the database. I assume this search bar is coded into your theme. Otherwise it would be the standard WordPress search bar widget, which you could remove from your widget area. If the former, then perhaps you can check with the developer for a safe way to remove it. Best, Christopher M.