Remove SharePoint sites from One drive search

harpal rana 1 Reputation point
2022-02-17T14:35:56.62+00:00

I want to remove specific SharePoint online sites from One drive search screen. What are the possible options

OneDrive Management
OneDrive Management
OneDrive: A Microsoft file hosting and synchronization service.Management: The act or process of organizing, handling, directing or controlling something.
1,247 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ceasar Chen_MSFT 4,406 Reputation points
    2022-02-22T08:43:44.533+00:00

    Hi, @harpal rana
    Here is the detailed steps:

    1. Go to your search site. Navigate to Site Settings | Query Rules
    2. Within the Query Rules page, select 'Local SharePoint Results' for the context and then click 'New Query Rule'
    3. Within the New Query Rule dialogue, provide a title for the rule, e.g. 'Remove Site X from results'
    4. Ignore the query conditions - you want it to fire for all queries
    5. In the Actions section, click the link 'Change ranked results by changing the query'
    6. 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'
    7. 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.