SharePoint Online: How to change the placeholder text in the search box

Published Jul 13 2021 04:52 AM 995 Views
Super Contributor

Placeholder text is the text that appears in the search box before user starts typing into it. The placeholder text may help your users about what to expect from search if you’ve configured a custom results page or changed behavior of search in other ways.

 

By default SharePoint online site has Search this site as default placeholder text in the search box at the top of your page. This is a very generic placeholder text & sometimes you may want to change this placeholder text to something more specific or relevant to current site or site collection.

 

You can change the placeholder text in the search box for a specific (sub) site or an entire site collection using PnP PowerShell. Follow below steps to change the placeholder text in the search box:

 

Install/Update PnP PowerShell module:

You can run the following command to install the PnP PowerShell cmdlets:

 

 

Install-Module -Name "PnP.PowerShell"

 

 

 

If you have previously installed the PnP PowerShell module, you can run the following command to update it:

 

 

Update-Module -Name "PnP.PowerShell"

 

 

 

Connect to SharePoint site:

You can connect to a SharePoint site using below PnP PowerShell command (use administrative account):

 

 

Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/siteName -UseWebLogin

 

 

 

Change the placeholder text:

To change the placeholder text in search box for a given (sub) site run the following command:

 

 

Set-PnPSearchSettings -Scope Web -SearchBoxPlaceholderText "Search Work @ SPExplorer Site"

 

 

 

Alternately, if you want to change the placeholder text for all the sites in a site collection, you can use below command:

 

 

Set-PnPSearchSettings -Scope Site -SearchBoxPlaceholderText "Search Work @ SPExplorer Site"

 

 

sharepoint-online-how-to-change-the-placeholder-text-in-the-search-box.png

 

Reset to default placeholder text:

If you have changed the placeholder text in search box previously & now you want to reset it to the default placeholder text, you can run the following command after connecting to a SharePoint site:

 

 

Set-PnPSearchSettings -Scope Site -SearchBoxPlaceholderText ""

 

 

 

sharepoint-online-how-to-reset-the-placeholder-text-in-the-search-box.png


This article is originally posted at: SharePoint Online: How to change the placeholder text in the search box 

%3CLINGO-SUB%20id%3D%22lingo-sub-2542220%22%20slang%3D%22en-US%22%3ESharePoint%20Online%3A%20How%20to%20change%20the%20placeholder%20text%20in%20the%20search%20box%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2542220%22%20slang%3D%22en-US%22%3E%3CP%3EPlaceholder%20text%20is%20the%20text%20that%20appears%20in%20the%20search%20box%20before%20user%20starts%20typing%20into%20it.%20The%20placeholder%20text%20may%20help%20your%20users%20about%20what%20to%20expect%20from%20search%20if%20you%E2%80%99ve%20configured%20a%20custom%20results%20page%20or%20changed%20behavior%20of%20search%20in%20other%20ways.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBy%20default%20SharePoint%20online%20site%20has%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3E%3CSTRONG%3ESearch%20this%20site%3C%2FSTRONG%3E%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eas%20default%20placeholder%20text%20in%20the%20search%20box%20at%20the%20top%20of%20your%20page.%20This%20is%20a%20very%20generic%20placeholder%20text%20%26amp%3B%20sometimes%20you%20may%20want%20to%20change%20this%20placeholder%20text%20to%20something%20more%20specific%20or%20relevant%20to%20current%20site%20or%20site%20collection.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20change%20the%20placeholder%20text%20in%20the%20search%20box%20for%20a%20specific%20(sub)%20site%20or%20an%20entire%20site%20collection%20using%20PnP%20PowerShell.%20Follow%20below%20steps%20to%20change%20the%20placeholder%20text%20in%20the%20search%20box%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-290374129%22%20id%3D%22toc-hId-290374129%22%3EInstall%2FUpdate%20PnP%20PowerShell%20module%3A%3C%2FH4%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20run%20the%20following%20command%20to%20install%20the%20PnP%20PowerShell%20cmdlets%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EInstall-Module%20-Name%20%22PnP.PowerShell%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20you%20have%20previously%20installed%20the%20PnP%20PowerShell%20module%2C%20you%20can%20run%20the%20following%20command%20to%20update%20it%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EUpdate-Module%20-Name%20%22PnP.PowerShell%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1517080334%22%20id%3D%22toc-hId--1517080334%22%3E%26nbsp%3B%3C%2FH4%3E%0A%3CH4%20id%3D%22toc-hId-970432499%22%20id%3D%22toc-hId-970432499%22%3EConnect%20to%20SharePoint%20site%3A%3C%2FH4%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20connect%20to%20a%20SharePoint%20site%20using%20below%20PnP%20PowerShell%20command%20(use%20administrative%20account)%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EConnect-PnPOnline%20-Url%20https%3A%2F%2Ftenant.sharepoint.com%2Fsites%2FsiteName%20-UseWebLogin%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--837021964%22%20id%3D%22toc-hId--837021964%22%3E%26nbsp%3B%3C%2FH4%3E%0A%3CH4%20id%3D%22toc-hId-1650490869%22%20id%3D%22toc-hId-1650490869%22%3EChange%20the%20placeholder%20text%3A%3C%2FH4%3E%0A%3CP%3E%3CSPAN%3ETo%20change%20the%20placeholder%20text%20in%20search%20box%20for%20a%20given%20(sub)%20site%20run%20the%20following%20command%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3ESet-PnPSearchSettings%20-Scope%20Web%20-SearchBoxPlaceholderText%20%22Search%20Work%20%40%20SPExplorer%20Site%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAlternately%2C%20if%20you%20want%20to%20change%20the%20placeholder%20text%20for%20all%20the%20sites%20in%20a%20site%20collection%2C%20you%20can%20use%20below%20command%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3ESet-PnPSearchSettings%20-Scope%20Site%20-SearchBoxPlaceholderText%20%22Search%20Work%20%40%20SPExplorer%20Site%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--156963594%22%20id%3D%22toc-hId--156963594%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22sharepoint-online-how-to-change-the-placeholder-text-in-the-search-box.png%22%20style%3D%22width%3A%20822px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295428iDBFC20D862D29070%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22sharepoint-online-how-to-change-the-placeholder-text-in-the-search-box.png%22%20alt%3D%22sharepoint-online-how-to-change-the-placeholder-text-in-the-search-box.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1964418057%22%20id%3D%22toc-hId--1964418057%22%3EReset%20to%20default%20placeholder%20text%3A%3C%2FH4%3E%0A%3CP%3E%3CSPAN%3EIf%20you%20have%20changed%20the%20placeholder%20text%20in%20search%20box%20previously%20%26amp%3B%20now%20you%20want%20to%20reset%20it%20to%20the%20default%20placeholder%20text%2C%20you%20can%20run%20the%20following%20command%20after%20connecting%20to%20a%20SharePoint%20site%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3ESet-PnPSearchSettings%20-Scope%20Site%20-SearchBoxPlaceholderText%20%22%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22sharepoint-online-how-to-reset-the-placeholder-text-in-the-search-box.png%22%20style%3D%22width%3A%20824px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295429i1CD5FA88C13026E6%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22sharepoint-online-how-to-reset-the-placeholder-text-in-the-search-box.png%22%20alt%3D%22sharepoint-online-how-to-reset-the-placeholder-text-in-the-search-box.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CHR%20%2F%3E%0A%3CP%3EThis%20article%20is%20originally%20posted%20at%3A%26nbsp%3B%3CA%20title%3D%22SharePoint%20Online%3A%20How%20to%20change%20the%20placeholder%20text%20in%20the%20search%20box%22%20href%3D%22https%3A%2F%2Fganeshsanapblogs.wordpress.com%2F2021%2F06%2F20%2Fsharepoint-online-how-to-change-the-placeholder-text-in-the-search-box%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ESharePoint%20Online%3A%20How%20to%20change%20the%20placeholder%20text%20in%20the%20search%20box%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2542220%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22sharepoint-online-how-to-change-the-placeholder-text-in-the-search-box.png%22%20style%3D%22width%3A%20822px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295436iE4EBBE7CEBFC1FA5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22sharepoint-online-how-to-change-the-placeholder-text-in-the-search-box.png%22%20alt%3D%22sharepoint-online-how-to-change-the-placeholder-text-in-the-search-box.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20article%20we%20will%20see%20how%20to%20change%20the%20placeholder%20text%20in%20the%20SharePoint%20search%20box%20using%20PowerShell.%20Placeholder%20text%20is%20the%20text%20that%20appears%20in%20the%20search%20box%20before%20user%20starts%20typing%20into%20it.%26nbsp%3B%3CSPAN%3EThe%20placeholder%20text%20may%20help%20your%20users%20about%20what%20to%20expect%20from%20search%20if%20you%E2%80%99ve%20configured%20a%20custom%20results%20page%20or%20changed%20behavior%20of%20search%20in%20other%20ways.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2542220%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EGetting%20started%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHow%20to%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Jul 13 2021 04:52 AM
Updated by: