How to Use Content Filters, Content Search Conditions and Link Filters

Last updated: 2026-10-20

Narrow tasks down to the items, links or sites you care about with content filters, content search conditions and link filters, including Excel input files and AND/OR groups.

Overview

Filters narrow a task down to the items, links or sites you actually care about. Without filters, everything in scope is processed. Add a filter and only what matches your conditions is included.

The same condition builder appears in several places:

Where

What it filters

Tasks

Content Filters tab

Files, folders and list items, by their properties (name, path, size, dates, columns, etc.)

Item Inventory, Unlabeled Widely Shared Files, Stale Content Open To Everyone, Permissions, Sharing Links, Open To Everyone, Privileged Access Inventory, Check Account Permissions, Clone Account, Add User, Prepare site for link correction, Find Links, Find & Replace Links

Content filters tab (Copy)

Which items are copied

Copy Lists, Copy Sites, Check before you copy

Settings tab (Content Search)

Which items are searched and reported, including by file content

Content Search, Checked Out Files, Web Part Search

Content Filters tab (Content Search)

Which items have their text replaced

Search & Replace (replace text in file contents)

Link Filters tab

Links found inside content, by their URL

Find Links, Find & Replace Links

Only sites where (Discovery)

Which sites are found, by their properties

Discovery

Everywhere it works the same way: you build a list of conditions, decide whether they are combined with AND or OR, and optionally put some of them in a group. Any text condition can compare against a list of values read from an Excel input file instead of a single typed value. Only the list of things you can filter on changes from place to place.

Tip: Filtering turns on automatically as soon as the first condition is added, and turns off when the last one is removed. There is no separate “Enabled” switch.

Licensing: On some editions, content filtering is an Enterprise feature for certain tasks. When it isn’t included, the page shows a notice and the rules are read-only.


Content Filters

Adding a condition

  1. Open Edit Options → Content Filters.

  2. Click Add condition. The condition editor opens.

  3. Pick what to check from the first drop-down (for example File Name, Last Modified Date, SharePoint Column).

  4. Pick the comparison (for example contains, is before, greater than).

  5. Enter the value.

  6. Pick AND or OR in the Join with the rule above drop-down.

  7. Click Add. You can also press Enter in the value box.

To change a condition later, click the pencil icon on its row, adjust it, and click Update. Click the × icon to delete it, or Clear all at the bottom to remove every condition.

The line at the bottom of the list summarizes what the filter does, for example:

3 conditions in 2 rules · an item is included when any rule matches

What you can filter on

The options offered depend on the task type.

Category

Filter

Value type

Properties

File Name, Item Title, Item/File/Folder Path, File Extension, Content Type, Sensitivity Label, Retention Label, Current Version, Item Id, Item Guid, Checked Out To

Text

Total Size (MB), URL Path Length

Number

Major Versions Count, List Item Attachments Count (Item Inventory, Unlabeled Widely Shared Files and Stale Content Open To Everyone only)

Number

Is Checked Out, Is Folder

Yes / No

Created and Modified

Created Date, Last Modified Date

Date

Permissions

Has Unique Permissions (Content Search only)

Yes / No

SharePoint Metadata

Any SharePoint Column

Text

SharePoint Column — checks one specific column; enter the column’s internal name (e.g. ProjectCode, not Project Code)

Text

Comparisons

Value type

Comparisons

Text

contains, does not contain, is equal to, is not equal to, starts with, ends with, does not start with, does not end with

Number

is equal to, is not equal to, greater than, less than, greater than or equal to, less than or equal to

Date

is before, is equal to, is later than (or equal to), is between dates

Yes / No

is true, is false

Text comparisons are not case-sensitive: Budget, budget and BUDGET all match the same items.

Examples

Goal

Condition

Only PDFs

File Extension · is equal to · pdf

Files with “Q3” anywhere in the name

File Name · contains · Q3

Skip anything in an Archive folder

Item, File or Folder Path · does not contain · /Archive/

Files larger than 100 MB

Total Size (MB) · greater than · 100

Untouched since before 2022

Last Modified Date · is before · 1/1/2022

Created during 2024

Created Date · is between dates · 1/1/2024 and 12/31/2024

Only items where the Department column is Finance

SharePoint Column · Department · is equal to · Finance

Only folders

Is Folder · is true


Content Search Conditions

Content Search tasks use the same condition builder, with extra filters that look inside files and columns.

  • Content Search, Checked Out Files, Web Part Search: the conditions are on the Settings tab.

  • Search & Replace: the conditions are on their own Content Filters tab. They decide which items have their text replaced.

You can use everything listed under What you can filter on, plus:

Category

Filter

What it checks

Content

File Content

The text inside the file (Word, Excel, PDF, etc.)

File Content or Any Column Value

The file’s text or any of its column values

HTML File Content

The page source of web pages (.aspx, .html)

Permissions

Has Unique Permissions

Whether the item has broken inheritance

Tip: Text you type on the Content Search Search tab is added here automatically, one contains condition per line, joined with OR. Editing or deleting one of those conditions on the Settings tab updates the Search tab too.

Examples

Goal

Condition

Files that mention a project code

File Content · contains · PRJ-2041

Pages that still embed the old intranet

HTML File Content · contains · oldintranet.contoso.com

Items with broken inheritance in the Legal library

Item, File or Folder Path · contains · /Legal/ AND Has Unique Permissions · is true

Files that mention any client in a list

File Content · contains · ANY value in client-names.xlsx


Discovery Site Filters

In Discovery, the Only sites where box uses the same builder to choose which sites are found. The first row (Site template is one of) is fixed; add conditions below it with Add condition, Add group or Use an input file.

Filter

Value type

Site Url, Site Title, Site Description, Site Classification, Site Sensitivity

Text

Created Date, Last Modified Date

Date

Goal

Condition

Only project sites

Site Url · contains · /sites/proj-

Sites not changed in two years

Last Modified Date · is before · 1/1/2025

Sites listed in a spreadsheet

Site Url · is equal to · ANY value in sites-to-review.xlsx


Link Filters

Link Filters decide which links a Link task looks at. Links whose URL doesn’t match your conditions are ignored: they aren’t reported, and they aren’t replaced in Find & Replace tasks.

  1. Open Edit Options → Link Filters.

  2. Click Add condition.

  3. The filter type is always Link Url. Pick a comparison and enter a value.

  4. Click Add.

Comparisons are the same text comparisons as Content Filters (contains, starts with, is equal to, etc.).

Examples

Goal

Condition

Only links to the old intranet

Link Url · contains · oldintranet

Only links to a specific old site

Link Url · starts with · https://contoso.sharepoint.com/sites/hr

Everything except mailto links

Link Url · does not start with · mailto:

Only links to PDF files

Link Url · ends with · .pdf

On the Link Filters page (and the Content Search conditions list), the AND / OR label above each row is a drop-down: you can change how the rules combine at any time without reopening the editor.


Using an Input File (Excel)

When you need to compare against many values (a list of file names, item IDs, old domains, etc.), put them in an Excel file instead of adding dozens of conditions.

How to add an input-file condition

  1. Click Use an input file (or click Add condition and turn on the Use input file switch at the top right of the editor).

  2. Pick the filter type and comparison as usual.

  3. Choose ANY value in or ALL values in (see below).

  4. Click the browse button and select your .xlsx file.

  5. A progress strip shows the values being read. When it’s finished, click Add.

The condition shows up as, for example:

File Name is equal to any value in 'C:\Lists\files-to-copy.xlsx'

Excel file format

Rule

Detail

File type

.xlsx only

Worksheet

Only the first worksheet is read

Column

Values must be in column A. Other columns are ignored, so you can use them for your own notes.

One value per row

Each non-empty cell in column A is one value

No header row

Row 1 is treated as a value. Don’t put a column title there.

Empty rows

Skipped

Example — files-to-copy.xlsx

A

B (ignored)

1

Budget 2025.xlsx

Finance

2

Board Minutes - March.docx

Exec

3

Org Chart.pdf

HR

4

5

Onboarding Guide.docx

HR

This file gives four values: row 4 is empty and is skipped, and column B is ignored.

Example — old-domains.xlsx (for Link Filters)

A

1

oldintranet.contoso.com

2

contoso.sharepoint.com/sites/legacy-hr

3

fileserver01

Used with Link Url · contains · ANY value in, this finds every link that points to any of those three locations.

ANY vs ALL

Option

The item matches when…

ANY value in

it matches at least one value in the file

ALL values in

it matches every value in the file

The comparison you pick determines which option makes sense, so the editor only offers the valid one:

Comparison

Option

Meaning

is equal to, starts with, ends with

ANY only

Matches if it equals / starts with / ends with any value in the list

is not equal to, does not contain, does not start with, does not end with

ALL only

Matches only if it differs from every value in the list (i.e. it’s not in the list)

contains

ANY or ALL

ANY: contains at least one of the values. ALL: contains every value.

Examples

Goal

Condition

Copy only the files named in a list

File Name · is equal to · ANY value in files-to-copy.xlsx

Process everything except the items in a list

Item Id · is not equal to · ALL values in exclude-ids.xlsx

Files whose name contains both “2025” and “Final”

File Name · contains · ALL values in a file with rows 2025 and Final

Links pointing at any retired domain

Link Url · contains · ANY value in old-domains.xlsx

Good to know

  • The file is read again every time the task runs. If you update the Excel file, the next run (including scheduled runs) uses the new values. You don’t need to edit the task. Keep the file in a location the task can still reach when it runs.

  • Input files work with text filters only. They aren’t available for dates, numbers, or yes/no filters.

  • Large lists are fine. Item Id, Item Guid, Item Title and Item Path with is equal to or is not equal to are matched by lookup, so even files with hundreds of thousands of rows stay fast.

  • If you cancel the read, or it fails, the task reads the whole file again when it starts. A partially read list is never used.

  • Make sure the file isn’t locked by another program (for example open in Excel with unsaved changes) when you browse to it.


Combining Conditions: AND, OR and Groups

AND vs OR

Join

Item is included when…

AND

all of the conditions match

OR

any one of the conditions matches

All conditions at the same level share the same join. If you change AND to OR on one row, every row at that level changes with it. This keeps the logic unambiguous: you never get a mix like A AND B OR C at one level.

Example — AND: PDFs that haven’t been modified since 2022

File Extension is equal to 'pdf'
AND  Last Modified Date is before '1/1/2022'

Example — OR: Word or Excel files

File Extension is equal to 'docx'
OR   File Extension is equal to 'xlsx'

Tip: For long OR lists of the same filter type, use one input-file condition with ANY value in instead.

Groups

A group is a box of conditions that is evaluated as one unit, like brackets in a formula. Use a group when you need to mix AND and OR, for example “A and (Bor C)”.

  • The group’s header shows how its conditions combine: all of these (AND) or any of these (OR).

  • The group as a whole then joins with the other rules at the top level using the top-level AND / OR.

  • Groups sit at the top level. A group can’t be placed inside another group.

How to build a group

New conditions are added to the group you created most recently, so build the filter in this order:

  1. Add the top-level conditions first, choosing the top-level join (AND or OR) in Join with the rule above.

  2. Click Add group.

  3. Click Add condition. Before clicking Add on the group’s first condition, set Join with the rule above to how the conditions inside the group should combine.

  4. Add the rest of the group’s conditions.

Example 1 — A AND (B OR C)

“Files in the Projects library that are either PDFs or larger than 50 MB.”

  1. Add: Item, File or Folder Path · contains · /Projects/ — join AND

  2. Click Add group

  3. Add: File Extension · is equal to · pdf — join OR (this sets the group to “any of these”)

  4. Add: Total Size (MB) · greater than · 50

Result:

Item, File or Folder Path contains '/Projects/'
AND  ┌ any of these (OR) ─────────────────────┐
     │ File Extension is equal to 'pdf'       │
     │ OR  Total Size (MB) greater than '50'  │
     └────────────────────────────────────────┘

Item

Path has /Projects/

PDF

> 50 MB

Included?

/Projects/Plan.pdf (2 MB)

✔

✔

✘

Yes

/Projects/Video.mp4 (300 MB)

✔

✘

✔

Yes

/Projects/Notes.docx (1 MB)

✔

✘

✘

No

/HR/Policy.pdf (1 MB)

✘

✔

✘

No

Example 2 — A OR (B AND C)

“Anything checked out, plus any old file over 100 MB.”

  1. Add: Is Checked Out · is true — join OR

  2. Click Add group

  3. Add: Last Modified Date · is before · 1/1/2023 — join AND (this sets the group to “all of these”)

  4. Add: Total Size (MB) · greater than · 100

Result:

Is Checked Out is true
OR   ┌ all of these (AND) ─────────────────────────┐
     │ Last Modified Date is before '1/1/2023'     │
     │ AND  Total Size (MB) greater than '100'     │
     └─────────────────────────────────────────────┘

Item

Checked out

Modified before 2023

> 100 MB

Included?

Report.docx

✔

✘

✘

Yes

Archive.zip (2019, 400 MB)

✘

✔

✔

Yes

Old.pdf (2019, 1 MB)

✘

✔

✘

No

New.mp4 (2025, 900 MB)

✘

✘

✔

No

Example 3 — When you don’t need a group (Link Filters + input file)

“Links to any retired domain, but not the ones that are already pointing at the archive site.”

  1. Add: Link Url · contains · ANY value in old-domains.xlsx — join AND

  2. Add: Link Url · does not contain · /sites/archive

Result:

Link Url contains any value in 'old-domains.xlsx'
AND  Link Url does not contain '/sites/archive'

No group is needed here: a single input-file condition already acts as an OR across every row of the file.


Tips & Best Practices

  1. Test on a small scope first. Run a report-only task (or Find Only for links) against one site or library to confirm the filter includes what you expect before running a Copy or Replace.

  2. Read the summary line. “an item is included when all rules match” vs “when any rule matches” tells you at a glance whether the top level is AND or OR.

  3. Prefer input files over long OR chains. They’re easier to maintain, they’re re-read on every run, and they’re faster for large lists.

  4. No header row in Excel. This is the most common input-file mistake. A header like File Name in A1 becomes a value to match.

  5. Use internal names for SharePoint Column. Display names with spaces won’t match. You can find the internal name at the end of the column’s settings URL (Field=...).

  6. Plan groups before you click. Add top-level conditions first, then groups, and pick each group’s AND/OR before adding its first condition.