How to Import Link Find & Replace Rules from Excel

Published:

Last updated: 2026-11-04

Bulk-load link find and replace rules from an Excel workbook instead of typing them one by one. Covers the five-column layout, match types, Matched part vs Whole link, and rule order.

Import Find & Replace rules from Excel

Instead of typing rules one at a time, you can list them in an Excel (.xlsx) file and click Import. Click the ⓘ icon beside Import at any time to see the format.

Download the example: Find-Replace-Import-Example.xlsx

Set up the workbook

Put one rule on each row of the first sheet. A header row is optional.

Column

What to enter

If left blank

A – Old Value

The link, or part of a link, to find

The row is skipped

B – New Value

What to put in its place

You are asked whether to keep the row

C – Match Type

Contains, Starts with, Exact match, Wildcard or Regular Expression

Contains

D – Method

Matched part or Whole link (Contains and Starts with only)

Matched part

E – Note

Anything that helps you remember why the rule exists

—

Matched part or whole link?

  • Matched part swaps only the text you typed. The rest of the link (site, folders, file name) stays the same.

  • Whole link replaces the entire link with the new value. Use this for ID-based links such as Doc.aspx?sourcedoc=…, where nothing of the old link is worth keeping.

Examples

A – Old Value

B – New Value

C – Match Type

D – Method

What it does

Doc.aspx?sourcedoc={6F2A…90AB}

https://contoso2.sharepoint.com/sites/hr/Documents/Policy.docx

Contains

Whole link

Any link containing this ID becomes exactly the new link.

https://contoso.sharepoint.com

https://contoso2.sharepoint.com/sites/hub

Exact match

(blank)

Only the bare tenant address changes. Longer links are left alone.

/sites/hr/Shared Documents/

/sites/hr/Documents/

Starts with

Matched part

…/sites/hr/Shared Documents/2024/plan.docx becomes …/sites/hr/Documents/2024/plan.docx.

https://contoso.sharepoint.com

https://contoso2.sharepoint.com

Contains

Matched part

https://contoso.sharepoint.com/sites/hr/plan.docx becomes https://contoso2.sharepoint.com/sites/hr/plan.docx.

Tip: You can also type the label shown in the rules table into column C, for example Contains · whole link, and leave column D blank.

Good to know

  • Rules run from top to bottom. Put specific rules above broad ones. In the example, the tenant-wide rule is last so it doesn't change links before the more specific rules can match them.

  • Export uses the same layout. Click Export to get your current rules in this format, edit them in Excel, and import them again.

  • Preview first. Turn on Flag only and run the job to see what would change before any links are rewritten.

Related guides