How to remove Site Collection from search in SharePoint 2013

This blog is about “How to remove Site Collection(s) from being searched in the Intranet Portal in SharePoint 2013”?.  Very simple, we can use the “Query Rules” function in the SharePoint and deploy this type of Security. We will be doing this by editing Search Results Web Part.

First of all write down the name of the Site Collection that you want to hide from search, for example my Site Collection name is Now I will go to my home page of the portal and make sure that I have the Site Collection Administrator rights.

Now, I will go to the intranet page where I have  my Search Box located and will do the following:

1 – Access the Search Box

Search Box
Search Box

2 – Type anything and see what results it is bringing, for ease I will type “Hello” and see the results


3 – In the search results page, I will click the Settings menu, and then click Edit Page.


4 – In the Search Results Web Part, I will click the Search Results Web Part Menu arrow, and then click Edit Web Part.


5 – In the Web Part tool pane, in the Search Criteria section, I will click Change query.

And we need to build our own query in the “Advanced Mode”, so that our top secret site collection is not searchable in the Intranet’s Search Engine. I will write the below query:

Keyword filter = Query from the search box

Property Filter = Path

Add Keyword Filter -> Not contain -> Manual Value ->

And now click the “ Add Property Filter”, you will see a query in the Query Text field as:

{searchboxquery} –Path


You can test the query and see the new results. Contents from the top secret Site Collection will not be visible in the Search Results.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.