How to Limit SharePoint Search to Selected Hub Sites and Private Sites
Question details
The user needs to configure a SharePoint hub search to return results from specific associated sites and only the private sites accessible to the current user, while excluding unrelated tenant sites.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Configuring search scopes on a SharePoint Hub site to balance the global visibility of public sites with permission-trimmed access to private sites.
- Observed behavior
- By default, the hub search only includes sites directly associated with the hub. Unassociated private sites, even if accessible to the searching user, are excluded from the results unless the search scope is modified.
Ensure you have SharePoint Administrator privileges and the PnP PowerShell module installed on your device to successfully modify search scope settings.
Change Hub Search Scope to Tenant Level via PnP PowerShell
Modify the default search scope from the current hub to the entire organization, allowing permission-trimmed access to private sites.
By default, searching a SharePoint hub only returns results from sites explicitly linked to that hub. To include unassociated private sites that the user has permission to view, you must expand the search scope to the tenant level.
You can achieve this using PnP PowerShell commands to adjust the search settings. Note that SharePoint automatically security-trims search results, meaning users will still only see private sites they have permission to access. However, this method may include other unrelated tenant sites.
Launch PowerShell on your computer as an administrator.
Run the command: Connect-PnPOnline -Url https://tenantname.sharepoint.com/sites/sitename (replace with your actual tenant and site URL).
Execute the command: Set-PnPSearchSettings -SearchScope Tenant to change the default search scope to the entire organization.

Associate Private Sites Directly with the Hub
If modifying the search scope to the tenant level includes too many unrelated sites, associate the required private sites directly to the hub.
Boost Your Productivity with WPS Office
While managing complex SharePoint permissions and search scopes requires specific Microsoft ecosystem tools, you can handle all your daily document needs using WPS Office. It provides a lightweight, comprehensive suite for creating, editing, and sharing documents effortlessly.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the Software: Run the downloaded installer file and follow the simple on-screen instructions to complete the setup.
- 3. Start Creating: Open WPS Office and instantly begin editing your documents, spreadsheets, and presentations with high compatibility.

Frequently Asked Questions
Why are my private SharePoint sites not showing up in hub search results?
By default, the search scope on a hub site is restricted to the hub level. Unassociated sites, including private team sites you have access to, are excluded from the results unless they are directly linked to the hub or the search scope is broadened.
Does changing the search scope to Tenant expose private sites to unauthorized users?
No. SharePoint search results are strictly security-trimmed. Users will only see content and sites in their search results that they have explicit permission to view, regardless of the search scope level.
What is PnP PowerShell and why do I need it for this configuration?
PnP PowerShell is a cross-platform module providing robust administrative commands for SharePoint Online. It is required here because modifying the default modern search scope behavior from 'Hub' to 'Tenant' cannot be done directly through the standard SharePoint graphical user interface.




