SharePoint Online: Change the “Search this site” text in the Search Box

Requirement: Change the “Search this site” default placeholder text in the SharePoint Online site search box.

How to Set the Search Box Text in SharePoint Online?

By default, the site search box in the modern SharePoint Online search box has “Search this site” as the search label. We can change this placeholder text to something meaningful to make it more relevant. E.g., wouldn’t it make more sense to set it as “Search Operations Portal” instead of saying “Search this site” in the Operations portal site?

change search this site placeholder text in sharepoint online

Well, Here is the PowerShell script to change the search box default text:

$SiteURL = ""
$SearchBoxText ="Search Operations Portal"

#Connect to the site
Connect-PnPOnline -Url $SiteURL -Interactive

#Set the default search box text
Set-PnPSearchSettings -Scope Site -SearchBoxPlaceholderText $SearchBoxText

And the result:

set search this site text in sharepoint online

You can also set the search box’s placeholder text at the web level as:

Set-PnPSearchSettings -Scope Web -SearchBoxPlaceholderText $SearchBoxText

To reset to the default text, use the following:

#Reset to the default search box text
Set-PnPSearchSettings -Scope Site -SearchBoxPlaceholderText ""

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published. Required fields are marked *