Configure

Change the Placeholder text in SharePoint Search Box

This sample script shows how to change the placeholder text in SharePoint online search box for a given (sub) site and/or for all the sites in a site collection.

Summary

This sample script shows how to change the placeholder text in SharePoint online search box for a given (sub) site and/or for all the sites in a site collection.

Scenario inspired from this blog post: SharePoint Online: How to change the placeholder text in the search box

Outupt Screenshot

powershell

# SharePoint site collection url
$siteUrl = "https://<tenant>.sharepoint.com/contoso"

# Connect to SharePoint Online site  
Connect-PnPOnline -Url $siteUrl -Interactive

# Change the search box placeholder text for a given (sub) site
Set-PnPSearchSettings -Scope Web -SearchBoxPlaceholderText "Search Contoso Site"

# Change the search box placeholder text for all the sites in a site collection
Set-PnPSearchSettings -Scope Site -SearchBoxPlaceholderText "Search Contoso Site"

Contributors

Author(s)
Ganesh Sanap

Disclaimer

THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Tool documentation & references

Keep exploring