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
hjiiihjiii 

how to remove Search option on the top of salesforce main window

hi,

 i have problem of logo fitting in my project due to search option present in salesforce main window so i want help to remove search option.  

 

 

Ankit AroraAnkit Arora

If you want to remove standard search from home page, it's not possible by any configuration but there is a work around using JS

 

Create a new html component in narrow home  page component, add below script code in it 

 

<div id="demoContainer"><script 
language="JavaScript">try{var
pa=document.getElementById("demoContainer").parentNode.parentNode;
pa.style.display = "none";}catch(err){alert('There was an error on this
webpage='+err.description);}</script><script
language="JavaScript">function removeSerchbox(){var a = [];var re =
new RegExp('\\bsearchCell\\b');var els =
document.getElementsByTagName("td");for(var i=0,j=els.length; i<j;
i++)if(re.test(els[i].className))a.push(els[i]);var
parent=a[0];parent.style.display='none';} var oldonload = window.onload;
  if (typeof window.onload != 'function')    {     window.onload =
oldonload;   } else {     window.onload = function() {      if
(oldonload) {      oldonload();    }    removeSerchbox();   }  }
</script></div>

 

Let me know if you still face any problem.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

Shailesh DeshpandeShailesh Deshpande
The search option that appears at the top besides the app logo is the GLobal Search which is enabled when you enable the chatter. If your org is OK with not using chatter, then you can disable the chatter. With this you will have search box present on the sidebar instead of having it besides app logo.

P.S. I myself would prefer the solution provided by Ankit though.
mpatilmpatil
I added the component but can still see the search bar at the top of the home page. Am I missing anything?