Skip to main content

Batch Update Hyperlinks and Bookmarks in Word

Moving a document library to SharePoint, or from one content management system to another, changes the address of almost every file. Word documents keep pointing at the old locations: links to intranet pages, links to sibling files on a network share, and bookmarks that other documents jump to. Readers click, get an error, and stop trusting the library.

WordPipe is a batch editor for Microsoft Word. It applies a list of search and replace pairs to every DOC, DOCX and RTF file in the folders you choose, including hyperlink addresses and bookmark names. This guide explains how to batch update hyperlinks and bookmarks in Word as part of a platform migration, and what to check so the new library works on day one.

When to Use This

Link and bookmark rewriting belongs in the cutover plan whenever the storage location or the naming scheme of your documents changes. Typical triggers are:

  • File share to SharePoint Online. Links written as \\fileserver\policies\ or S:\Policies\ must become site URLs.
  • On-premises SharePoint to a new tenant. The host name and site collection path change for every link.
  • CMS replacement. The new platform uses different URL patterns, for example /node/1234 becoming /docs/handbook/.
  • HTTP to HTTPS and domain changes. Every link to the retired host needs the secure address.
  • Bookmark standardization. Section anchors renamed to a consistent scheme so that documents which jump into each other keep working.

If links are already broken and you need to find out which ones, start with fixing broken links in multiple Word documents. For very large libraries, see updating hyperlinks in thousands of Word documents.

Step-by-Step Configuration

  1. Get the migration mapping. Ask the migration team or tool for the list of old paths and their new addresses. Do not guess patterns from a few examples, because folders are often flattened or renamed during a move.
  2. Enter the pairs, longest first. Put https://intranet.example.com/hr/policies/ above https://intranet.example.com/hr/. A short prefix processed first will match inside the long one and produce a half-updated address.
  3. Include link text pairs. Some authors pasted the full address as visible text. The address behind the link and the text on the page are stored separately, so add a pair for each.
  4. Add bookmark pairs. List each old bookmark name and the new one. Also list cross-references and links that target the bookmark, or they will point at a name that no longer exists.
  5. Select folders and back up. Choose the top-level folder with subfolders included, then copy it or turn on logging.
  6. Trial run. Process about twenty representative files, click several links in Word, and read the report. Then run the full set.
  7. Verify. Search the finished folder for the old host name and old share path. Any hit is a missed variant, such as an uppercase host or a trailing-slash difference.

Mapping examples

SituationSearchReplace
File share to SharePoint\\fileserver\policies\https://contoso.sharepoint.com/sites/policies/Shared Documents/
Protocol changehttp://oldsite.comhttps://newsite.com
Bookmark renamesec_returnsreturns_policy

Spaces in SharePoint paths are stored as %20 inside many links, so add a second pair for the encoded form.

Original Example: Fabrikam Logistics Moves a Handbook Library to SharePoint

Fabrikam Logistics retired a Windows file server and moved its operations handbooks to SharePoint Online over one weekend. The library held 3,800 Word documents, and the handbooks linked heavily to each other and to a shared glossary through bookmarks. The migration tool moved the files but did not touch the links inside them. Staff testing on Monday would have found hundreds of dead links.

The migration analyst took the folder mapping from the migration tool and entered four hyperlink pairs and two bookmark pairs. A typical link before the run read: See \\fabfs01\ops\handbooks\Safety.docx#sec_ppe for protective equipment rules. After the run it read: See https://fabrikam.sharepoint.com/sites/ops/Handbooks/Safety.docx#ppe_rules for protective equipment rules. The glossary bookmark sec_ppe was renamed to ppe_rules in the same pass, so the jump target stayed valid.

A twenty-file trial showed one miss: links written with a mapped drive letter, S:\ops\handbooks\, which the mapping had not listed. A fifth pair fixed that. The full run took 26 minutes and recorded 21,300 replacements across 3,550 files; the other 250 documents contained no links. A final search for fabfs01 found none. Manual checking of the same set had been estimated at three weeks of effort by two people, and the work was finished the same Sunday with about four hours of review.

Common Pitfalls

  • Missing address variants. The same server can appear as an IP address, a short name, a fully qualified name and in different capitalization. Search a sample to find them all.
  • URL encoding. A space may be a literal space in one link and %20 in another. Add a pair for each form.
  • Renamed bookmarks without references. Changing a bookmark and not the links or cross-references that use it silently breaks them.
  • Relative links. A link such as ..\shared\form.docx breaks when folders are flattened. Convert these to full addresses.
  • Links in headers, footers and text boxes. Make sure those parts of each document are selected.
  • Skipping the backup. Keep a copy of the original folder until the new library has been used in production for a few weeks.

FAQ

Can WordPipe change the visible link text as well as the hyperlink address?

Yes. The address behind a link and the text readers see are separate, so include a pair for each when the text shows the full URL.

What happens to cross-references when I rename a bookmark?

Cross-references and links that point to the old bookmark name will break unless they are updated in the same run, so list both the bookmark and the references to it.

Does it work on links that point to other Word files on a network share?

Yes. UNC paths, mapped drive letters and relative file links are stored as text and can be rewritten to SharePoint or web addresses.

How do I check the result without opening every file?

Review the WordPipe report for counts per file, open a sample of documents and test their links, then run a second search for the old address to confirm none remain.

Related Use Cases

Start Using WordPipe Today

Download WordPipe Free Trial

Buy WordPipe Now