Correcting or Removing Broken Links on a Web Page

Correcting or Removing Broken Links on a Web Page

If you receive errors like this in your Ally tool reports, you will need to correct the links on the identified pages.

HTML content contains broken links

Once you click on the error message you will see a list of pages with broken links. Unfortunately the Ally report does not tell you which link(s) are broken on a page. You can do some visual inspection and click every link on the page to see which one(s) are broken but that is very time consuming.

If you have a Franklin College provided Drupal site, you can use our Link Sanitizer module to vastly cut down the time to resolve these issues.

Overview

Broken links can disrupt navigation and create accessibility barriers, especially for users relying on screen readers or keyboard navigation. Regular maintenance of links in a Drupal website is essential.

This guide explains how to find, fix, and remove or correct broken links using Drupal’s Link Sanitizer tool. By keeping links accurate and accessible, you help ensure a smoother, more reliable experience for all users.

Scan for Broken Links

Step 1: Open Link Sanitizer

Once logged in to your Drupal website, you will click on the Configuration tab near the top of the page.

Admin Menu

Under Content Authoring, click on Link Sanitizer.

You will see the screen shown below.

Step 2: Start Scan

Click on the Scan button to start the scan for broken links.

Begin Scan

The Link Sanitizer will start scanning your website for broken links. This may take a few minutes, depending on the size of your website.

Scanning progress

For smaller sites, you will only need to run the scan once. After the scan is complete, the screen below will appear.

For larger sites, you may need to click the Scan button multiple times to complete a full site scan. If additional scans are required, the Link Sanitizer will prompt you to continue (see example below).

Once the scan is complete, you will see the message shown below. The screen will display the node (page), content type, the original URL of each broken link, the last modified date, the action status, and whether the action has been applied.

Please note: Do not run the scan again or click the red Reset button. Resetting will completely clear your current selections and scan results, returning the tool to its default state. When you click Reset in Link Sanitizer, you also won’t be able to see the work you did in the tool anymore. However, any links you removed or updated are still saved in the revision history of each page you edited.

 

In sites with lots of content, server timeouts can occur occasionally.  When this happens you will see an AJAX error. It's ok - just click the Continue to the Error page link.

You will see the message below and you will click on Scan to resume your scan:

Removing Broken Links

Over time, older content can collect broken or outdated links that affect usability and accessibility. To keep your site accurate and easy to navigate, you may want to identify and remove these links in one batch, streamlining maintenance and improving the overall user experience. These instructions focus on removing outdated links while leaving the original text in place.

Step 1: Filter by Date and Content Type

If you want to batch remove broken links, you can filter older documents for link removal. The page and text will still be there, it simply removes the link.

The date range you select may vary by department, depending on how each defines “old” content. See details on Recommended Classification of Old Content below.

Recommended Classification of Old Content

According to the University Archivist, older news and event content does not need to be retained beyond its period of usefulness. Each Department may determine its own criteria for what “useful” means. News and Event content that falls outside the Department’s recommended timeframe may be unpublished. Other types of content must be retained according to USG Records Retention Policies. If you would like to batch unpublish old documents, please refer to our documentation.

If the Department chooses to retain older content, any broken links should be addressed to ensure accessibility. Removing broken links is an acceptable option. The Filter by Page Last Updated Date tool can help identify content that predates the Department’s recommended timeframe.

Step 2: Select by Content Type and Date Range for Link Removal

Here are the steps for removing links from your website by content type and date range.

Click on Filter by Page "Last Updated" Date to expand the filters.

You can select Any Content Type to show all pages or select a specific content type to view.

For this example, we’re going to filter all of the News Articles from a certain date range.

Click under Content Type to expand the drop down of content types.
Select Article.

Click on the From and To fields and add dates for the date range you want to view.
Click Apply Filter to view your selection.

Note: If you want to make a new selection, click the grey Reset button to clear the filter. If not, move on to Step 2.

Step 2: Select Nodes (pages)

After applying the filter, the articles within your selected date range will appear. To select all of these pages at once, click the checkbox next to Node at the top of the list. If you only want to select specific articles, simply check the box next to each individual article where you want the link removed.

Select for Batch Removal

Step 3: Select for Removal

Click on the blue Select for Removal button. The link text will stay on the page, but the broken or outdated links will be removed.

Click Button

After you click Select for Removal, the selected pages will no longer appear on the screen, and the broken links will be removed.

Step 4: View Removed Pages

You can view the removed links by clicking on the Removed or Corrected tab near the top of the page.

Module Interface - Removed or Corrected Tab

Correcting Broken Links

Sometimes links in even newer content will stop working and lead to pages that no longer exist.

Correcting broken links helps make sure users can get where they expect to go. This guide shows you how to find broken links and update them, so your content stays helpful and easy to use. This is a manual process and is more involved then removing broken links.

Step 1: Select for Manual Fix

Any remaining links must be fixed manually. You can either select all items at once by checking the box next to Node, or choose specific items and update only those links. The option you choose depends on how much time you have available to work on the fixes.

To fix a link on a single page, check the box next to the corresponding node (page). If you’d like to select them all, check the box next to Node at the top of the list.

Broken Link List - select for manual fix

Click on ‘Select for Manual Fix’

Click Button

Step 2: View Broken Link(s) for Manual Fix

The page(s) you selected have now been moved to a new tab. Click on the Manual Fix tab near the top of the page.

Module Interface - Manual Fix tab

Highlight the text of the Original URL and copy it (you’ll need this to find the link on the page).
Click on the node (in this example it is Jaewoo Lee).

Click to manually correct link

You will be taken to the page with the broken link.

Step 3: Find the Broken Link

In your browser, go to Edit and then Find or Find in your Page (this may be different depending on the browser you are using).

Search for broken link on your page
Paste in the link name you copied earlier

Step 4: Search for Replacement Link

Open a new browser window and search for a replacement link, using a search engine (i.e. Google). In this example, look for a directory page for Daniel Kifer.

Search google for replacement link

Search through the options and try to find one that works for the page. You can even check http://archive.org for an archive replacement
Note: Some times you won’t be able to find a new link. Follow the instructions below (Step 6) to remove the link.

Step 5: Fix the Broken Link

When you find the correct link, copy the URL and return to the page with the broken link.

Update the link by pasting in the new URL and clicking Update.

Edit to change the link

Save the Page:

Click Save Button

Step 6: Remove the Link

If you cannot find a suitable replacement, remove the link from the text.

Click to remove link

Save the Page:

Click Save button

Step 7: Mark as Corrected

Check the box next to the node where the link was updated.

Click on the blue Mark as Corrected button. This will move the page to a new tab.

Mark as Corrected

Step 8: View the Corrected Links

Your page will no longer display the corrected link. It has been moved to the Removed or Corrected tab.

Click on the Removed or Corrected tab to view the corrected pages.

Module Interface - Removed or Corrected Tab

You will repeat this process for each link you want to manually correct.

Navigating the Link Sanitizer

If you’d like to return to the list of pages that still contain broken links, click on Pending Review. You can then follow the Steps for Select for Removal or Select for Manual Fix.

Tabbed Interface

Once you have worked through all your broken links and links have been removed or manually corrected, and no other links remain on the “pending review” tab, you are done.

Starting Over with a New Scan

Ally for Web will scan your site every Saturday and will provide a new report of broken links. If it finds more broken links on the subsequent scan you can come back and start over with a new scan. We recommend doing this at least once a month.

To start over and remove all applied filters, click the red Reset button. This action completely clears your current selections and returns you to the default state.
When you click Reset in Link Sanitizer, you won’t be able to see the work you did in the tool anymore. However, any links you removed or updated are still saved in the revision history of each page you edited.

Click Reset Button

:clipboard: Related articles