How to Filter SharePoint Hub Sites with Web Parts
Question details
The user needs to display active and archived project sites separately on a SharePoint Hub using a web part, based on a specific naming convention.

- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Organizing and displaying project hub sites by their current status (active vs. archived) on a central hub page.
- Observed behavior
- It is unclear how to configure a web part to filter sites by name, and built-in web parts do not fully support separating sites based solely on naming conventions.
Ensure you have SharePoint Administrator privileges if you plan to use PowerShell, and keep in mind that users will only see sites they have permission to access.
Understand SharePoint Web Part Visibility Limitations
Learn how SharePoint's built-in security trimming affects what sites are displayed in web parts.
Currently, there is no out-of-the-box SharePoint web part that fully automates the separation of active and archived sites purely by a naming convention.
SharePoint relies heavily on security trimming. This means that regardless of how a web part is configured, SharePoint will only display sites that the current logged-in user has explicit permissions to view. If an archive site restricts access, standard users will simply not see it.
Navigate to your SharePoint site settings and verify that the intended audience has at least Read access to the specific active or archived project sites you wish to display.
Try using the Highlighted Content web part to filter documents or site pages across the hub based on custom metadata rather than relying strictly on the site naming convention.
Retrieve Associated Hub Sites Using PowerShell (Admin)
SharePoint administrators can use PowerShell commands to generate a complete list of all sites associated with a hub site without needing to be added to every individual project site.
Manage Your Exported SharePoint Reports with WPS Office
While SharePoint manages your hub site structures, WPS Office is the perfect lightweight, free alternative to Microsoft Office for opening, editing, and analyzing your exported PowerShell site lists.
- 1. Download and Install: Download WPS Office for free from the official website and install it on your device.
- 2. Open WPS Spreadsheet: Launch the WPS Spreadsheet application to handle your data reports.
- 3. Import and Analyze: Open the CSV file exported from your SharePoint PowerShell script to easily filter and categorize your active and archived hub sites.

Frequently Asked Questions
Can I filter the SharePoint Sites web part by site name?
Built-in SharePoint web parts like the 'Sites' web part currently do not support advanced filtering by site name or naming conventions to automatically separate active and archived projects.
Why can't certain users see project sites on the hub?
SharePoint utilizes security trimming. This means users will only see the sites, pages, and content that they have been explicitly granted permission to view. If they lack access to an archived site, it will not appear in their web parts.
Is there a way to automate separating active and archived sites?
Instead of relying on web parts, administrators typically manage site lifecycles by adjusting site permissions, modifying custom metadata, or using Power Automate flows to formally transition active sites into an archived state.





