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:

#Parameters
$SiteURL = "https://crescent.sharepoint.com/sites/Operations"
$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 - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

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

  • Can we show the text by user language basis?

    Reply

Leave a Reply

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