BGA Web Site style guide—Checking for broken links

Web sites have an unfortunate habit of changing, which means that links to other people’s web sites that used to work fine have a habit of breaking. Therefore, you should check all the links on the pages you are responsible for periodically.

It would be very boring if you had to go and manually click on all the links yourself. Fortunately, you don’t have to. There are any number of computer programs to automate the process.

I normally use the W3C link checker. Go there, type in the URI of the page you want checked, and click on the ‘Check’ button. It is a very thorough checker, so if it finds no problems on your page, you can be happy. However, if it does find some problems, you will discover that it has a bit of an attitude problem! Its error messages are fairly forthright, some might even say rude.

However, if using the checker as above is too much trouble, you can make the process simpler. In your web browser, create a bookmark/favourite called something like ‘Check links’, and with location/address/URL:

javascript:(function(){location.href="http://validator.w3.org/checklink?uri="+escape(location.href)+"&hide_type=all&depth=&check=Check"; return 0;})()

(Don’t worry, you don’t need to understand that. Just copy and paste it into the location/address/URL filed of the bookmark). It can be quite difficult to create a bookmark from scratch. The secret is to bookmark a random page, then find that bookmark, open it's properties dialog box, and then edit the various bits.

Once you have set that up, go to any web page you like, then open that bookmark, and you should find that it checks the links of the page you were just looking at. Magic! I find this so convenient that I keep it on my personal toolbar.





Last updated Sun Jul 08 2007. If you have any comments, please email the webmaster on web-master AT britgo DOT org.