What you learn from fixing 5 years worth of broken links

I just spent two hours finding and fixing all of the broken links on my site. The Broken Link Checker plugin is invaluable for this task (as well as extremely usable!) Here's what I learned:

  • Don't hotlink images. Hotlinking is where you embed an image into your page that is hosted on someone else's page. Not only does it cost the other person bandwidth to serve the request, but it is extremely vulnerable to breaking whenever the other person decides to change their site, or (worse) change the image hosted at that URL, so where you thought you were showing an image of a cat, you are actually showing a porn image meant to embarrass you. The majority of broken links were hotlinks.

  • The alternative to hotlinking is downloading the image, uploading it to your own site and then displaying it from there. This is pretty tedious in Wordpress; there should be a plugin that lets you do this.

  • Think very, very hard before deleting or moving resources on your site. Once you create a resource, you should serve the content at that URL forever, or use a 301 redirect to indicate the new location of the resource. If you don't, you are breaking the Internet. A related problem is that it's very easy to break links: change your page title, move subdomains, or move a small section of content, and you've caused a problem for your site's users.

  • If a link is broken on your site, you've created a problem for every single person that links to that resource, because now they are pointing their visitors to a broken link. The best way to handle this is with a 301 redirect. However many webmasters don't know they broke links, or don't care, so I had to update many links by hand to point to the new resource.

    It would be nice if there were some kind of link wiki service that you could update to point to the correct resource; then everyone could just point their links to the wiki and the Internet would not be broken when someone updates the location of their content.

  • I had a much better chance of finding what I was looking for when the URL described the post content than when the URL was opaque (e.g. http://example.com?p=519). It's also good SEO to have the title of your posts displayed in the post URL's, so you should definitely try to do this for your posts.

  • As a webmaster, you should try to make your 404 (File Not Found) page helpful for users. Try parsing the URL and outputting the results of a site search onto the page, in case you can find the content under a different name. At the very least, you should set up your CMS to send an email whenever your site serves a 404. That's an easy way to find broken links on your site that are hurting users.

All in all, there were 2300 total links on my site, and about 230 of them were broken, for about 10%. This means that, roughly speaking, a user has a 1 in 10 chance of being disappointed when they click on a link on my site; I cut that down to about 20 broken links by unlinking content that 404's or updating it to point to the correct resource. This was a good use of my time; it's important to keep a good user experience for all of my users, even the ones that will only visit once.

Liked what you read? I am looking for work.

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments are heavily moderated.