All product videos

How to find and fix broken links in SharePoint

Scan pages, documents, list columns and navigation for links that return 404 or redirect, review each HTTP status, then fix them in bulk.

Learn about SharePoint Broken Link Manager ยท Watch on YouTube

Transcript

Runtime 6:25. Created by the Cognillo product team. Narrated with an AI-generated voice.

0:00 Thanks for joining. Before we begin, just a disclaimer: this video was written by the Cognillo team, and this voice-over was AI-generated. In this video, we'll find and fix broken links in SharePoint. Not just simple page links, but complex ones too: links inside Word, PowerPoint and PDF files, Excel cells and formulas, UNC file share paths, mapped drives, site navigation, and server-relative links that start with slash sites.

0:28 This Architecture knowledge base was moved from an on-premises intranet and a file share, and its content still points to the old locations. On Tasks, pick the site, then the two lists we care about: Project Delivery and Site Pages. Under Links, choose Find broken links.

0:45 Click Next. The summary confirms this job only reads. It tests every link on pages, in documents and in list items, and changes nothing. Under Lists and content, turn on Excel cell links and Excel formula links, so links inside workbooks are tested too.

1:01 Run now. The toolkit opens each page and file, pulls out every link, and tests it. Eighteen items, forty-eight links, and twenty-three of them are broken.

1:12 Switch the view to All broken links. Every one returns a 404, and look at the mix. Links to the old intranet, UNC paths to the file share, file colon links, a P drive path, a server-relative link that starts with slash sites, links inside a PDF and a PowerPoint deck, a URL shortcut file, Excel cells and formulas, and even the Quick Launch menu.

1:36 Scroll right, and Link Source Details shows exactly where each link lives: the web part on a page, the PDF page, the PowerPoint slide, or the Excel sheet and cell. That's what makes complex links fixable.

1:51 Now let's fix them. Back on Tasks, under Links, choose Fix or replace links in bulk, and click Next. Note the warning. With Flag only off, this job rewrites links in place.

2:04 Under Lists and content, turn the Excel cell and formula links on again, so the fix reaches inside workbooks.

2:12 On Find and replace, turn on Flag only first, so the first run is a preview that changes nothing. Then click Add rule. Rules run in order, from top to bottom, so we'll start with the server and work down to the paths.

2:25 Rule one is the server. Find H T T P, intranet dot cognillo dot local, and replace it with H T T P S, cognillo demo dot sharepoint dot com. Only the server part changes; the rest of each link is left for the next rule.

2:39 Rule two is the path. Find slash sites slash architecture, and replace it with slash sites slash architecture-knowledge-base. Because this rule starts with a slash and not with H T T P, it also catches server-relative links, the ones that begin with slash sites and have no server at all. And the intranet links that rule one just rewrote flow straight into it.

3:00 Rules three and four cover the file share. The UNC path to cog F S zero one goes to the Project Delivery library on the new site, and so does the mapped P drive.

3:18 Four rules: server first, then the site path, then the two file share roots. Each rule matches part of a link, so everything under the old root follows along. And Preserve Author keeps Modified By and the modified date as they were.

3:33 Run the preview. With Flag only on, nothing changes in SharePoint. The report just lists every link that would be rewritten.

3:42 Switch the view to Validate Find and Replace. It puts the old and the new address side by side, so you can check every replacement before anything is changed.

3:52 Twenty-two links have a match. Link Url is the old address, and New Link Url is exactly what it will become. Intranet links get the new server and the new site path. The UNC paths, the file colon links and the P drive all become SharePoint URLs, and the rest of each path, including encoded spaces, is kept. Now look at the fourth row. It's the server-relative link, slash sites slash architecture, with no server at all. Rule one never touched it, but rule two did, and it's rewritten to the new site path. Twenty-two matches, and nothing replaced yet.

4:25 Happy with the preview? Click Edit options, and turn Flag only off. The banner now warns that this run makes changes.

4:33 Run now. Each link is rewritten where it lives: in the page, inside the Word, PowerPoint, PDF and Excel files, in the shortcut, and in the Quick Launch.

4:48 Twenty-two of twenty-two links replaced, across all eighteen items, with no errors. Is Link Replaced is ticked on every row, New Link Url is now the live address, and because Preserve Author was on, the files keep their original editor and modified date.

5:04 To prove it, go back to Tasks, pick the same site and the same two lists, and run Find broken links again, with Excel cell and formula links on. It's the same read-only scan we started with, so it changes nothing. It just tests every link again at its new address.

5:37 Switch the view to All broken links: zero. Not one link is left pointing at the old intranet, the old site path or the file share.

5:46 And on All links, every one of the forty-eight now returns two hundred, OK. Every link opens the page or file at its new SharePoint location. Simple links, complex ones, and relative ones, fixed in a single pass.

6:08 Thanks for watching. Try Find broken links and Fix or replace links on your own sites, before or after a migration. And if you have any questions, email hello at cognillo dot com.