Use the Link Checker Module to Find Broken Links in Drupal
That’s where Drupal’s Link Checker module comes in. It’s an excellent module that saves you a lot of time. This tutorial will help you to get started with it.
Configuration
- Use our install Drupal 7 modules tutorial to install the Link Checker module.
- Go to Configuration -> Content Authoring -> Link checker.
- Select which areas of your site you’d like to scan with the module.
- Select if you want it to scan internal and/or external links. I recommend both. External links are prone to break without you knowing about them, so scanning for them would be a good idea.
- Select which types of links you’d like to check. I recommend <a> and <img> tags, unless otherwise needed. With the <img> tag enabled, it will now look for broken images too.
- I recommend leaving the rest of the settings on this page as they are, unless otherwise needed.
- Finally, save the configuration.
Once you save the first time, it will scan your site for content, but not actually check the status of the links yet. If you have a lot of content, it will take a while to complete and you’ll see the progress bar.
In the example, I hadn’t set up any comments or blocks yet, so that’s why it shows 0 for each.
Finding the Broken Links
Go to Reports > Broken links.
In this area you’ll find a list of any broken links. Initially, all the links will be unchecked until Drupal’s cron runs.
Unless you changed the “interval” setting in Link Checker’s options, the module will check for broken links every four weeks via Drupal’s cron. If you want to run it manually, I’ll show you how in the next step.
Let’s run the cron manually to make sure everything’s working.
- Go to Configuration > Cron.
- Click “Run cron”.
Now go back to Reports -> Broken Links. You’ll see a list of all your broken links. It will also include the response status and description.
In the example, I had four links total and it found the one broken link. Now, I can click on the “Edit node” link to go directly to the node and fix it.
Within the node, Link Checker gives me a notification of the broken links in the node. This is useful if you haven’t accessed the Reports area recently, but you’re editing the content.
As you can see, Link Checker is an awesome module that has the potential to save you hours upon hours of searching your site manually. Hope you enjoyed the intro to Drupal’s Link Checker!
Great at what it does, but it complains about lots of links that are not broken, particularly Google Maps, but many others. I suspect most of the others are timing out.
Thanks Walter, that’s very helpful feedback.
How have you embedded google maps? I wonder how linkchecker is able to see the maps. Never seen invalid detections of any links. In all cases it is the remote server that is doing something awful wrong. What other type of links do you mean?
Link check of [url=http://maps.google.com/maps/ms?msa=0&hl=en&ie=UTF8&t=h&msid=212405832541970858631.0004a68af40433de5408b&ll=41.186406,-74.33075&spn=0.155025,0.205307&z=11&source=embedfailed]http://maps.google.com/maps…[/url] 65 times (status code: 301).
They are an iframe.
View [url=http://maps.google.com/maps/ms?msa=0&hl=en&ie=UTF8&t=h&msid=212405832541970858631.0004a68af40433de5408b&ll=41.186406,-74.33075&spn=0.155025,0.205307&z=11&source=embed]Stateline Trail Parking[/url] in a larger map
————
This one
[url=https://www.linkedin.com/pulse/20140602202806-10474781-on-heretics-entrepreneurs-and-dissenting-voices-in-business]https://www.linkedin.com/pu…[/url]
is reported as an error 900
This one
[url=http://www.fs.fed.us/cgi-bin/Directives/get_dirs/fsh?2309.18]http://www.fs.fed.us/cgi-bi…[/url]
is reported as error 503
maybe it’s useful to have a check on body and addition field of the taxonomies
I’m using this module and when it runs, it fails to find internal links that are 404’ing and also fails to find links to nodes that are unpublished (403). Any clues?