Forum Discussion
Hide Personal OneDrive Results from Search
I have received complaints from users who are becoming confused when they find their own work OneDrive files in the SharePoint search results. The either worry someone else can see their confidential files, or simply don't understand the concept of checking the URL.
Is there an easy way to remove these results from the default search?
Additionally, are there any reasons we should not restrict these results?
6 Replies
- PankajBadoniIron Contributor
While it's generally not recommended to hide OneDrive content from Microsoft Search—since results are security-trimmed and only visible to the file owner or those with access—if you still wish to remove these results for clarity or user experience, you can try the following options:
Option 1: Rest Query Filter
Exclude OneDrive results from search by adding a filter to your query:AND NOT path:"https://yourtenant-my.sharepoint.com/*"
Option 2: Site Settings
Each user's OneDrive is a SharePoint site. You can disable indexing by visiting:
https://yourtenant-my.sharepoint.com/personal/username/_layouts/15/srchvis.aspx
Then set “Allow this site to appear in search results?” to No.
The change does not take effect immediately. Instead, it depends on when the site is next crawled and reindexed by Microsoft Search.
- MarcelCroonenBrass Contributor
Consider posting a short internal explanation or intranet article that includes:
- A reassurance that only the user can see their own OneDrive files unless they’ve been explicitly shared.
- A tip to recognize OneDrive files in search (e.g., by looking at the URL path).There are a few considerations before you decide to restrict OneDrive content from search:
- User Convenience: Some users actually rely on seeing their recent files in search, including OneDrive files.
- Copilot & AI Features: Tools like Microsoft 365 Copilot use recent activity across all file types – including OneDrive – to deliver suggestions. Filtering this content may reduce effectiveness.
- Customizing verticals per audience or globally adds an extra layer of governance and support complexity. - grant_jenkinsIron Contributor
AlyssaSupreme I would highly recommend not hiding their OneDrive from SharePoint Search especially since there may be items in their OneDrive accounts that are potentially relevant (including files shared with them). I'd suggest providing some guidance so they understand that they will ONLY EVER see results for items they have access to.
If they did want to exclude items from their OneDrive, they could put this in the SharePoint Search Box (not ideal but would work). Note that you would change YOURTENANT to whatever your tenant's name is.
* AND NOT path:"https://YOURTENANT-my.sharepoint.com/*"
- NikolinoDEPlatinum Contributor
A simple way, though less common, is to adjust the search visibility at the user profile level. This allows you to ensure that specific users' OneDrive files are hidden from search, even within SharePoint.
Steps:
- Go to the Microsoft 365 Admin Center.
- Under Active Users, select the user whose OneDrive you want to hide from search.
- From the user’s settings, locate Search Visibility under their profile settings.
- Set the visibility option to "Do not show in search results".
This will prevent their personal OneDrive files from appearing in search results across the organization, including SharePoint.
My answers are voluntary and without guarantee!
Hope this will help you.
- AJK4024Copper Contributor
I do not have permission in my organization to view or manage the Microsoft 365 admin center.
How to I prevent my own files from appearing in my SharePoint search results? I would have already searched my local and OneDrive folders first, and I do not need to see the same irrelevant results of my files when searching my company's SharePoint site.- StephaneDCopper Contributor
Hi,
did you find a way?thanks