While working with the SharePoint site, I need to highlight the limited documents or news so at that time, I can use the highlighted content web part to highlight the content like documents, pages, news, images, videos, etc.
In this Modern SharePoint Online tutorial, we will show you how to Add a Highlighted content web part in SharePoint Online. Also, we will see how to customize the Highlighted content web part in SharePoint Online. Such as:
- Filter SharePoint Highlighted Content Web part
- Add a Custom query to Highlighted Content Web part in SharePoint Online
- How to enable audience targeting in SharePoint Online Highlighted content web part
SharePoint Online Highlighted Content Web Part
- By using this SharePoint Online Highlighted content web part, users can display the content that they want to highlight.
- A SharePoint Online Highlighted content web part can also display the content (documents, pages, news, images, videos, etc…)
- In this Highlighted content web part, by default, we get our most recent documents and we can also create and upload new documents.
- SharePoint Online Highlighted content web part helps to display the basic filter and Custom Query with CAML or KQL code.
- Before enabling the audience targeting in the Highlighted content web part, you should enable the audience targeting in the SharePoint Online document library or list.
Add a Highlighted content web part in SharePoint Online
For example, we have created a SharePoint Online page where we can add a Highlighted content web part per the requirement.
To do so, follow the below instructions are:
- Open the SharePoint site page -> Click on the Edit icon (right top corner) of the page as shown below:

- Now, click on the +(Add a new web part in column one)

- Search the Highlighted content web part -> Select Highlighted content web part like below:

- Once the Highlighted content web part is added, by default, we get the Most recent documents.

- And also dynamically we can select documents, pages, videos, or other content based on search and filtering options as shown below:

This is how to add Highlighted content web part to SharePoint Online.
How to filter a SharePoint Online Highlighted Content Web Part
Now, we will discuss how to filter a Highlighted content web part in SharePoint Online. Follow the below steps:
- Go to the Highlighted Content web part -> Click on the Edit icon as shown below:

Once click on the Edit icon we get three Filter options:
- Content
- Filter and sort
- Layout

Content
- When we will expand this Content drop-down, by default, the Source will be selected by This site. And, also we can choose various sources such as:
- A document library on this site
- This site collection
- This page library on this site
- Select sites
- All sites

- Now, select any (documents, pages, news, images, videos, etc…) that you need to highlight inside the Source drop-down. Example: I have chosen A document library on this site.

- Next, select the Company Documents under the Document Library drop-down option.

- Inside the Document type drop-down, where we can choose different formats like Word, Excel, Powerpoint, Onenote, PDF, Any, etc…
- Also, select the +Add document type to add a new document type.

This is how to change the Content in a Highlighted content web part.
Filter and sort
- Select the Filter and sort drop-down where, by default, we get Title includes the word option. Also, we choose any of the below options:
- Content includes the words
- Recently added
- Recently changed
- Created by
- Modified by
- Managed property

- For example, we can filter the Recently added documents and Search the keywords by using the Since drop-down (Last month).
- Also, we can add a new filter by using the +Add filter option, as shown below:

- Similarly, click on the Sort by drop-down -> Select the Most recent option among all options to get recent documents as shown below:

Layout
Let us see how to choose different types of layouts available in the highlighted content web part. To do so, follow the steps are:
- Click on the Layout drop-down -> Turn on the Show title and commands toggle.
- By default, it will be a Grid layout. If we want to change the layout, then choose the below options such as:
- List Carousel
- Compact
- Filmstrip

- Next, enter the items at a time (No of items must be between 1 to 500) in the Highlighted content web part.
- Also, if we want to Hide this web part (Highlighted content) then click on the Check box as shown below:

See below screenshot that how to filter a Highlighted content web part in SharePoint Online:

This is how to use a basic filter for the highlighted content web part in SharePoint Online.
Add a Custom query in SharePoint Online Highlighted content web part
Let’s see how to add a custom query in the highlighted content web part in SharePoint Online. We can get two query languages such as:
- KQL (Keyword Query Language)
- CAML (Collaborative Application Markup Language)
- Select the Custom query button -> Click on the Query drop-down -> Select the Source drop-down.

- Next, select Source (This site) -> Enter the KQL query in the Query box -> Click on the Apply button.
title:"About Company"

- Similarly, Select the Source (A document library on this site) -> Click on the Furniture Documents under the Document library.
- Next, provide the CAML query code in the Query box -> Click on the Apply button.
<View><Query>
<Where>
<Eq>
<FieldRef Name="Furniture Types"/>
<Value Type='Choice'>Furniture Documents</Value></Eq>
</Where></Query></View>
Where,
- FieldRef Name = The FieldRef element is a reference to the column
- Furniture Types = Choice column
- Furniture Documents = Name of the Document Library

- Refer to the below image that explores how we get a highlighted content web part after using the CAML query code:

This is how to add a custom query in SharePoint Online highlighted content web part.
Check: How to Enable Versioning in SharePoint Online Document Library
Enable audience targeting in SharePoint Highlighted Content web part
Before enabling the audience targeting in the Highlighted content web part, you should enable the audience targeting in the SharePoint Online document library or list.
Let’s see an overview of the Audience’s targeting:
- Audience targeting is to select a particular group of people who can see the content in SharePoint Online.
- By using audience targeting, we can share specific content that is relevant to specific people.
Note:
Even if we are enable the audience targeting, other user also can able to see the all content. That’s why we don’t think audience targeting is a replacement of the permissions or control security.
Refer to the screenshot below that can express how to turn on the Enable audience targeting option in a Highlighted content web part:

To use audience targeting, you must enable audience targeting for the SharePoint Online document library. To do so, follow the below steps are:
- Open the SharePoint Site contents page -> Click on the document -> Select ellipses (…) to Show actions -> Click on Settings as shown below:

- Select the Audience targeting settings under the Settings list like below:

- Select the check box to Enable the audience targeting, then click on the OK button.

- Now, back to the Document library, where we get an Audience column. Select the specific file -> Click on the Details pane (i).

- In the Details pane -> Select the Properties section -> Click on the Edit all option.
- Next, select the Audience (Enter up to 50 audiences) option -> Enter the name or email address of the group (SharePoint Online Group) -> Click on the Save button.

- Now, see the below image that how we can get an Audience column in the document library.

Now, we will see how to turn on the enable audience targeting to share specific content that is relevant to specific people in the Highlighted content web part.
To enable audience targeting, follow the below steps are:
- Go to the Highlighted Content web part -> Click on the Edit icon -> Select Filter section -> Turn on Enable audience targeting as shown below:

This is how to enable audience targeting in SharePoint Online.
Conclusion
In this Modern SharePoint Online tutorial, we will learn an Overview of the Highlighted content web part and how to Add a Highlighted content web part in SharePoint Online.
Also, we will see how to customize the Highlighted content web part in SharePoint Online. Such as:
- Filter SharePoint Highlighted Content Web part
- Add a Custom query to the Highlighted Content Web part in SharePoint Online
- How to enable audience targeting in SharePoint Online Highlighted content web part
You may like the following tutorials:
- SharePoint Online List Web Part
- News Web Part in SharePoint Online
- People Web Part in SharePoint Online
- SharePoint online countdown timer web part
- Planner Web Part in SharePoint Online

Preeti Sahu is an expert in Power Apps and has more than 6 years of experience working with SharePoint and the Power Platform. As a Power Platform expert for Power BI, Power Apps, Power Automate, Power Virtual Agents, and Power Pages, she is currently employed with TSinfo Technologies. She is the author of the book Microsoft Power Platform A Deep Dive. She also made a big technical contribution to SharePointDotNet.com in the form of articles on the Power Platform. She enjoys traveling and spending time with her family in her spare time.