In this SharePoint tutorial, we will discuss how to disable content on a SharePoint site to be searchable. Follow the steps to exclude SharePoint site or list from search results. The exact steps you can follow to exclude SharePoint site or list from search results in SharePoint 2013, SharePoint 2016 and SharePoint 2019 also.
Now, first, let us see how to disable content on a SharePoint site to be searchable and we will see in the SharePoint Online site.
One the SharePoint Online site and navigate to the Site settings page.
If you are using modern SharePoint site, click on the gear icon -> Site information -> View all site settings.
And if you are using classic SharePoint site, then click on Gear icon -> Site settings.
Then in the Site settings page, then click on Search and offline availability that is under Search section.
In the Search and Offline Availability page select No for Allow this site to appear in search results? in the Indexing Site Content section.
Once you save the page, it will exclude the SharePoint site from search result.
Now, we will see how to exclude SharePoint list or library from search results. There will be scenarios where we might not want to documents or list items to appear in the search result. We might want to exclude a particular library from the SharePoint search.
By following the below approach we can exclude a particular SharePoint list or document library from the SharePoint search results.
Open the SharePoint list or Library and then click on the List settings or Library settings page like below:
Then click on Advanced settings which is under General Settings of the library settings page.
Then in the Search section, select No for Allow items from this document library to appear in search results?
Once you click on Save the document library will not appear in the SharePoint search results.
We can also exclude documents from SharePoint search results by providing unique permission. You can assign unique permission to a particular SharePoint list, library, or even to a particular document.
Once you set unique permission to a document or document library, only people who has permission can see the document in the SharePoint search result.
Those who will not have permission, can not see the document in the SharePoint search result.
I have written a few complete articles, you can follow for SharePoint unique permission.
- SharePoint unique permissions to list & document library
- How to give unique permission to a folder in SharePoint Online document library
- How to implement SharePoint list item level permissions
- SharePoint permission levels | Create custom permission levels in SharePoint
Now, let us see how to disable content on a SharePoint Online site using PowerShell.
Here we will use PowerShell CSOM.
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" $siteUrl = "https://tsinfo.sharepoint.com/sites/TSInfoClassic/" $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $credentials= Get-Credential $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($credentials.Username, $credentials.Password) $web = $ctx.Web $ctx.NoCrawl = $True $ctx.Update() $ctx.ExecuteQuery()
Once you run the PowerShell script, if you will go to the Search and Offline availability, you will see No selected for Allow this site to appear in search results.
Now, we will see how to exclude SharePoint site from search result using PnP PowerShell.
Connect-PnPOnline -Url https://tsinfo.sharepoint.com/sites/spguides -Credentials (Get-Credential) $web = Get-PnPWeb $web.NoCrawl = $true $web.Update()
Now, we will see how we can disable content on a site to be searchable using PowerShell in SharePoint 2013.
Below is the PowerShell script you can use.
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue $web=Get-SPWeb -site https://<your-SharePoint2013-URL> $web.NoCrawl = $true $web.Update()
In this tutorial, we learned how to disable content on a SharePoint site to be searchable. I hope this article will help to solve the below queries.
You may like the following SharePoint search tutorials:
- SharePoint Search Schema, Crawl Properties, and Managed Properties
- SharePoint search managed properties
- Content Search web part in SharePoint Online
- SharePoint Online search result web part display documents created or modified by current user
- Display SharePoint Online List Items using a Content Search web part
- SharePoint Online customize search box web part
- Difference between classic and modern search experience in SharePoint Online
- SharePoint Content Approval – Approve/Reject documents or items
- SharePoint site owner – Detailed Guide
- Disable attachments in SharePoint list
- SharePoint alerts – Create and Manager Alerts in List or Library
- Disable content on a SharePoint site to be searchable
- enable content on a SharePoint site to be searchable
- sharepoint exclude document from search
- how to make sharepoint documents searchable
- Prevent documents from appearing in search results in sharepoint
- SharePoint 2013 exclude few documents from search results
- how to exclude site from search result in SharePoint
- exclude sharepoint site or list from search results
- exclude sharepoint list or library from search results
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site EnjoySharePoint.com