I want to remove the search bar completely from my website. I've had a hard time trying to figure this out.
4 Answers
Rather try this easy way by putting it into local.xml in your theme layout folder
<layout>
<default>
<reference name="header">
<remove name="top.search"/>
</reference>
</default>
</layout>
- Refresh your cache after saving this code.
Place a local.xml file in your template layout (e.g. app/design/frontend/yourpackage/yourtheme/layout/local.xml
) with the following content
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="header">
<remove name="top.search" />
</reference>
</default>
</layout>
If you already have a local.xml file in there, just insert the <default>
node or the <remove>
node accordingly.
-
1
-
Please try again, I've been doing it this way for a long time :) make sure you put the local.xml file in the right place and clear your cache Commented Apr 29, 2015 at 23:29
-
What version you testing on? I have this setup correctly and the search bar does not get removed– ShaughnCommented Apr 30, 2015 at 0:53
It all depends on your theme, but they should all be the same. Open up the template:
app/design/frontend/[INTERFACE]/[THEME]/template/page/html/header.phtml
Then, change the following:
<?php echo $this->getChildHtml('topSearch') ?>
to:
<?php //echo $this->getChildHtml('topSearch') ?>
Clear caches and refresh. The search should disappear.
If you wanted to, you could disable the module completely, but i wouldn't recommend it as it will open up a whole new set of problems regarding dependancies, etc.
just open your "style.css" and find code #header-search
then add display: none;
in it or replace with display: block;
if available
-
-
-
Don't do following this. If it works, it doesn't mean, that its good solution Commented May 1, 2015 at 16:51
-
-
Not happened! your search bar will be hidden as you need, I don't know why others don't accept this method and set negative rating to my answer, I am so sorry for them!!– sIiiSCommented May 2, 2015 at 7:24