While working with a client, we needed a solution that allowed employees to quickly access the most recently uploaded documents across multiple document libraries within a SharePoint site. Instead of manually searching through each library, the SharePoint Highlighted Content Web Part.
In this tutorial, I’ll walk you through how the SharePoint Highlighted Content Web Part works and showcase several configuration options.
What Is the SharePoint Highlighted Content Web Part?
The Highlighted Content Web Part (HCWP) in SharePoint Online is a powerful, built-in web part that automatically displays content from your site or across your SharePoint environment. It’s designed to help users quickly find relevant documents, pages, news, videos, and other items—without any manual updates.
Add Highlighted Content Web Part to a SharePoint Site
To get started, we’ll first add the Highlighted Content Web Part to a SharePoint Online site page.
Here, I will show you how to add the SharePoint Highlighted content web part to a SharePoint Online site page. For that, please follow the instructions below.
- Open the SharePoint Online page where you want to add the Highlighted Content web part, and click Edit in the top-right corner. Select a section by clicking the + icon, then click the + icon within that section to open the web part search box. Search for “Highlighted Content,” select the web part, and finally click Republish to save your changes.

- Once you click on Republish, it shows the recent documents on the current site. By default, it displays the most recent eight documents on the current SharePoint site page, as shown in the screenshot below. We can also click See all to view all recent documents.

In this way, we can add the SharePoint Highlighted Content web part to the SharePoint Online site page. Once the Highlighted Content web part is added, we can change the layout.
Check out Content Approval in SharePoint Document Library
SharePoint Highlighted Content Web Part Layout
We can display the content in different layouts in the Highlighted web part layout. In the Highlighted Content web part, there are five layout types, namely:
- Grid
- List
- Carousel
- Compact
- Filmstrip
To change the layout, please follow the instructions below:
- Edit the SharePoint Online Highlighted Web Part. In the Properties pane, you can see the Layout options. By default, it is Grid. Select the layout of your choice, then click Republish.

- Since it is a Grid layout, you can view the content in a table. If you choose List layout, the content appears as a list, as shown in the screenshot below.

- If you choose the Carousel layout, then the content displays as shown in the screenshot.

- If you choose Compact Layout, then you can see the content as shown in the screenshot below.

- If you choose Filmstrip layout, then the content displays as shown in the screenshot below.

Read Pin to Quick Access in a SharePoint Document Library
Highlighted Content Web Part Content By Type and Source
Here, we can select the content based on the source and type that we want to display in the Highlighted Content web part. Under this content, we have again two options, namely,
- Source
- Type
Highlighted Content Web Part based on Source
In the SharePoint Online Highlighted Content web part, you can choose what content to display by selecting a Source.
The available source options include:
- This site: Displays content from the current site.
- A document library on this site: Displays content from a selected document library within the current site.
- This site collection: Displays content from the current site and all its subsites.
- The page library on this site: Displays content from the Pages library of the current site.
- Select sites: Displays content from one or more specific SharePoint Online sites you choose.
- All sites: Displays content from all SharePoint Online sites you have access to.
By default, the source is set to This site, but you can choose any option from the dropdown. Here is a screenshot for your refernece:

Here, I selected this site as the source so that I can see the documents from the current site in the SharePoint Online Highlighted Content web part.

Check out Events Web Part in SharePoint Online
Highlighted Content Web Part Based on Type
Here, we can display the content in the highlighted content web part based on the content type. We have different content types, including documents, pages, news, videos, images, events, issues, tasks, links, and contacts.
By default, it displays the documents.

We can also display content from multiple content types by clicking +Add content type, as shown in the screenshot below.

Here, I selected type as documents and events so that I can see the most recent documents and events in the Highlighted Content web part.

Highlighted Content Web part based on Document Type
The Highlighted Content web part also allows you to filter content by document type. When you select Documents as the Type in the Properties pane, you can further refine the results by choosing specific document formats such as Word, Excel, PowerPoint, OneNote, Visio, PDF, or Video.

Here, we can also display multiple document types in the Highlighted Content web part by clicking on + Add document type, as shown in the screenshot below.

Here, I selected the document types Excel and Word, so the Highlighted Content web part displays Word and Excel documents.

Check out SharePoint Online Hero Web Part
Filter and Sort in SharePoint Online Highlighted Content Web Part
Filtering and sorting are used to display content based on the filters we choose. For that, we should select the Filter option in the properties pane. Here are the instructions below:
- Edit the Highlighted Content web part, then the Properties pane will open on the right side. Below the statement, Use a basic filter to narrow search results, or use a custom query with CAML or KQL code, you will have an option: Filter. It is enabled by default, as shown in the screenshot below.

- Then, under Filter, you can see the Filter and Sort dropdown. Then click that dropdown to see the filter and sort dropdowns as shown in the screenshot below. By default, the filter dropdown has Title includes the words, and the Sort by dropdown has Most recent.

- You can choose any option from the dropdown to filter the content in the Highlighted Content web part. Here, we can view the content based on
- The title includes the words
- Content includes the words
- Recently added
- Recently changed
- Created by
- Modified by
- Managed property

- We can also select multiple filters to display data in the Highlighted Content web part by clicking +Add filters.
- Here, I gave a filter as created by Joni Sherman, and the Title includes the word HR. So, the Highlighted Content web part returned documents created by Joni Sherman whose titles contain the word HR.

- We can also display the content by using the Sort by dropdown. Here, we can view the content in the Highlighted Content web part based on
- Most recent
- Most Viewed
- Trending
- Managed property ascending
- Managed property descending

- Here, I set the sort to Trending, so the most trending documents are added to the SharePoint Online Highlighted content web part.

Check out Call to action Web Part in SharePoint Online
Implement Audience Targeting in the Highlighted Content Web Part
We can also enable audience targeting in the Highlighted content web part so that only a specific audience can see the content.
Note: Before enabling audience targeting in the Highlighted Content web part, you should enable it in the SharePoint Online document library.
Here are the steps to enable audience targeting:
- Open the SharePoint site contents page, then click the documents you want to enable audience targeting for. Then, besides that document, you can see three dots. Click on those dots. Then click on Settings.

- It will navigate to the settings page, then click on Audience targeting under the General settings.
- Then it will navigate to the audience targeting settings page, enable Audience targeting, and click on OK.

- Then you can see that the audience targeting column has been added to the document library. Then set the audience to only those who wanted to see the particular document.

- Then go to the Edit properties of the Highlighted Content web part. On the right side of the property panel, below Enable audience targeting, toggle it on. Then click on Republish.

In this way, we can enable audience targeting in the SharePoint Online Highlighted Content web part.
Now, let us see how the Query Works in the SharePoint Highlighted Content Web Part.
Check out People Web Part in SharePoint Online
Highlighted Content Web Part Using Custom Query
If you are familiar with using query languages, then you can use this Custom Query to display the content in the Highlighted Content web part.
To filter the documents, we can choose the custom query in the highlighted content web part. There are two ways that we filter the documents: they are
- KQL (Keyword Query Language)
- CAML (Collaborative Application Markup Language)
First, we should select the custom query in the properties pane. Please follow the steps below.
- Edit the SharePoint Highlighted Content web part. Click on Edit Properties. On the right side of the property pane, below the sentence “Use a basic filter to narrow search results, or use a custom query with CAML or KQL code,” select Custom Query, as shown in the screenshot below.

Highlighted Content Web Part based on KQL Query
To filter the content, we can select the KQL syntax query in the SharePoint highlighted content web part. Please follow the steps below.
- Select the Custom Query option in the SharePoint highlighted content web part.
- To use the KQL Query, we have to select the Source as This site, This site collection, and Select sites.
- In the Query text box, enter the KQL query and click the Apply button.
Here, I have added a query as the title: “HR”, so it filters the documents in the SharePoint site where the title includes the “HR”.

Highlighted Content Web Part based on CAML Query
To filter the content, we can select the CAML Query in the SharePoint highlighted content web part. Please follow the steps below.
- Select the Custom Query option in the SharePoint highlighted content web part.
- To use the CAML query in the SharePoint highlighted content web part, we have to select the Source as the Document library and the SharePoint site Pages library for this SharePoint site.
- In the Query text box, enter the CAML Query in the SharePoint highlighted content web part and select the Apply button.
Here, I have added the query to retrieve documents modified in the last 30 days; it filters and displays those documents.

Conclusion
Here, the SharePoint Highlighted Content web part helps us display the documents based on our requirements without manually browsing all document libraries. We can also display the records based on filters.
In this tutorial, I explained how to use the highlighted content web part in SharePoint Online with real examples.
You may also like the following tutorials:
- SharePoint Online Microsoft Forms Web part
- SharePoint Online Weather Web Part
- SharePoint Markdown Web Part
- SharePoint Online Code snippet web part

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.
This article doesn’t explain how to sort by title