Hi, @harpal rana
Here is the detailed steps:
- Go to your search site. Navigate to Site Settings | Query Rules
- Within the Query Rules page, select 'Local SharePoint Results' for the context and then click 'New Query Rule'
- Within the New Query Rule dialogue, provide a title for the rule, e.g. 'Remove Site X from results'
- Ignore the query conditions - you want it to fire for all queries
- In the Actions section, click the link 'Change ranked results by changing the query'
- Within the 'Build your query' dialogue, in the Property Filter dropdown box, select 'Path'. For the parameter, change it from the default 'contains' to 'Not starts with'. For the value, select 'Manual value' and then type the URL for the site you want to exclude. Then click the button 'Add property filter'
- You should see the Query text display something like {searchTerms} -Path=https://site/sub-site* displaying your site hierarchy up to the point that you want excluded. This is telling to the search engine to filter out all results that begin with that path. Note: this will also exclude any further sites beneath that URL
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.