Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
1 like 0 dislike
201 views
in SharePoint Online by 25 38 45

Is it possible to remove or hide the Search Box in SharePoint Online for a specific page?

hide sharepoint search box in sharepoint online

I have tried to use the PnP PowerShell to Hide the search box in SharePoint Online Pages as stated below:

Connect-PnPOnline -url https://company.sharepoint.com/sites/test -interactive
Set-PnPSearchSettings -SearchBoxInNavBar Hidden -Scope Web

But this PnP script hides Search Box on all SharePoint Pages, and I just need to hide SharePoint Search Box on a specific Page in SharePoint Online.


1 Answer

2 like 0 dislike
by 72 142 308
selected by
 
Best answer

Remove SharePoint Search Box for a specific Page in SharePoint Online

To hide SharePoint Search Box for a specific Page in SharePoint Online, you have to use CSS with the Script editor web part.

<style>
#O365_SearchBoxContainer_container{
display: none !important;
}

Output

Once you add the above CSS to a script editor web part, you will note that the search box has been hidden for a specific page in SharePoint online as below:
hide sharepoint search box for specific page sharepoint online using CSS

See Also, Enable Custom Script in SharePoint Online Using Admin Center

If you don’t ask, the answer is always NO!
...