function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nickname7Nickname7 

Is there a way to remove the search box in the header?

Hi,

 

Is there a way to remove the search box in the header? I need to provide my own search feature and ideally I can keep the search box but make it return the search results in the format I want it to look. Is there a way to do this?

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
Nickname7Nickname7

bob_buzzard's solution is good. Here is the code:

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script>
/* Hide the top search box */
var j$ = jQuery.noConflict();
j$(document).ready(function(){
j$(".searchCell").hide();
});
</script>

 I wished this was just a configuration and not so tightly integrated into chatter (what does this have to do with chatter!).

All Answers

bob_buzzardbob_buzzard

You can't configure this as far as I'm aware.  

 

You might be able to do it via javascript embedded in an HTML area in the sidebar, though it wouldn't work for pages that don't include the sidebar (reports and dashboards at least).

 

Here's a post from Jason Venable (aka TehNrd) which removes buttons using this technique - to adapt for your situation you'll need to locate the search elements and hide those:

 

http://www.tehnrd.com/show-and-hide-buttons-on-page-layouts/

Gopi NaiduGopi Naidu

Hi,

 

    There is a way to remove global search box which is displayed in header i.e, in salesforce, by default search

box is assoiciated with chatter and also connected to all objects.So go to chatter setting and disable chatter setting

check box.Then you may find search box in not avilable.

 

 

 

 

 

 

 

Thanks!

Nickname7Nickname7

bob_buzzard's solution is good. Here is the code:

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script>
/* Hide the top search box */
var j$ = jQuery.noConflict();
j$(document).ready(function(){
j$(".searchCell").hide();
});
</script>

 I wished this was just a configuration and not so tightly integrated into chatter (what does this have to do with chatter!).

This was selected as the best answer
haripriya.maturiharipriya.maturi

Hi Bob,

 

I want to remove search box from reports and dashboards also.. how can I achieve this.

 

 

Thanks and Regards,

Haripriya

bob_buzzardbob_buzzard

You can't - you have no way to influence those pages.

sfdcsushilsfdcsushil
Above solution does not work for me. Tried variour permutations/combinations, but did not work. 
Doug JodDoug Jod
For the search bar in templated community pages (Napili) you can use the css editor:
Community Builder -> Branding Editor -> Edit Custom CSS (pencil icon)
Then add this:
 
.search-container {
   visibility: hidden
}

 
Aine KelleherAine Kelleher
This worked awesomely for me Doug thanks!!
Chetan MhatreChetan Mhatre
.search-container {
  visibility: hidden
}

This Worked .
Alan Went 7Alan Went 7
Thanks so much Doug - That really solved my problem!
Sid SinhaSid Sinha

2023 Solution in CSS

.themeSearch { visibility: hidden;}