Remove sharepoint site and custom list from the search result
Today, I came across the requirement where I have to stop site to be crawl in search
Go to the Site Actions=> Site Settings => Site Administration => Search and offline availability.
We can manage the visibility of site and site's web page's web parts for search.
Using SharePoint object model:
Using Powershell:
#---------StopSearch
$site=Get-SPSite "http://servername:1111/"
$web=$site.RootWeb;
$web.AllowAutomaticASPXPageIndexing=$true
$web.ASPXPageIndexMode=[Microsoft.SharePoint.WebASPXPageIndexMode]::Never
$web.NoCrawl=$false
$web.Update()
#---------StartSearch
$site=Get-SPSite "http://servername:1111/"
$web=$site.RootWeb;
$web.AllowAutomaticASPXPageIndexing=$false
$web.ASPXPageIndexMode=[Microsoft.SharePoint.WebASPXPageIndexMode]::Never
$web.NoCrawl=$true
$web.Update()
For SharePoint Custom list:
Go to :
Using SharePoint Object Model
SPList list = ...
list.NoCrawl = true;
list.Update()
Using Powershell:
$site = Get-SPSite http://siteColl
$site | Get-SPWeb -Limit ALL | ForEach-Object {
foreach ($list in $_.lists)
{
$list.NoCrawl = $true
$list.Update()
}
}
$site.Dispose()
Go to the Site Actions=> Site Settings => Site Administration => Search and offline availability.
We can manage the visibility of site and site's web page's web parts for search.
Using SharePoint object model:
Using Powershell:
#---------StopSearch
$site=Get-SPSite "http://servername:1111/"
$web=$site.RootWeb;
$web.AllowAutomaticASPXPageIndexing=$true
$web.ASPXPageIndexMode=[Microsoft.SharePoint.WebASPXPageIndexMode]::Never
$web.NoCrawl=$false
$web.Update()
#---------StartSearch
$site=Get-SPSite "http://servername:1111/"
$web=$site.RootWeb;
$web.AllowAutomaticASPXPageIndexing=$false
$web.ASPXPageIndexMode=[Microsoft.SharePoint.WebASPXPageIndexMode]::Never
$web.NoCrawl=$true
$web.Update()
For SharePoint Custom list:
Go to :
- List Settings page, under General Settings, click Advanced settings.
- In the Search section, under Allow items from this list to appear in search results, select Yes to include all of the items in the list or library in search result or No to exclude all items from search results.
Using SharePoint Object Model
SPList list = ...
list.NoCrawl = true;
list.Update()
Using Powershell:
$site = Get-SPSite http://siteColl
$site | Get-SPWeb -Limit ALL | ForEach-Object {
foreach ($list in $_.lists)
{
$list.NoCrawl = $true
$list.Update()
}
}
$site.Dispose()
This guide on removing SharePoint sites and custom lists from search results is super useful! Just like DV Hosting streamlines your web services, mastering search settings can enhance your site management.
ReplyDelete