Why links break
Links on the web are fragile. A link breaks when the page it points to moves, is renamed, is deleted, or when the whole site it points to disappears. They also break through small mistakes, such as a typing error in an address, or a page whose web address changed when someone edited its title.
There are two directions to think about:
- Internal links point to other pages on your own site. You control both ends, so these should be the easiest to keep working.
- External links point to other people’s sites. Those can break at any time without notice.
There is also a third case, incoming links, where other sites or search results point to a page of yours that no longer exists. You cannot edit those links, but you can decide what visitors see when they follow them.
What visitors see
When a visitor requests a page that does not exist, the server returns an error status. The familiar one is the “404 Not Found” message. Others you may meet include errors in the 500 range, which usually mean the server had a problem, and “403” messages, which mean access was refused.
A missing page is unavoidable sooner or later. A confusing one is optional. A helpful error page says plainly that the page was not found, offers a link to the home page, and may include a search box or the main sections of the site. It should not be a blank screen, a technical code dump or a redirect to the home page that hides the problem.
Finding broken links
Start with the simplest methods.
- Click around. Visit the main navigation, footer links and your most important pages. This catches obvious problems.
- Check the pages you link to most. Pages with long lists of resources are the most likely to contain stale external links.
- Use a link-checking tool. Many free and paid checkers crawl a site and list links that return errors. Some site builders and content management systems have this built in or available as an add-on. Run it on a schedule rather than once.
- Look at your site’s reports. Analytics or search-visibility reports from your hosting or webmaster tools may list error pages that visitors actually requested. Reading website analytics can reveal which missing addresses are being asked for most often.
- Ask for reports. A short “report a problem” line or email address on the site lets visitors tell you about dead links.
Keep a list of what you find, noting the page the link is on, the broken address, and what you decided to do.
Deciding what to do
For each broken item, choose between three responses.
Repair
Repair the link when the target still exists but the address is wrong or has changed. Edit the link to point to the right place. For an external link, search for the new location of the same content, and make sure it is truly the same thing and not merely something similar.
Redirect
A redirect automatically sends visitors from an old address to a new one. It suits cases where a page has moved, been renamed, or been replaced by a clearly equivalent page. Points to consider:
- Use a permanent redirect when the move is meant to last. This tells browsers and search engines that the new address replaces the old.
- Send visitors to the most relevant page, not automatically to the home page. If the old page about “wedding photography prices” is gone, a page about your photography services is a better destination than a generic page.
- Avoid chains, where one redirect leads to another, and loops, where redirects point at each other. Both slow pages and can cause errors.
- Keep redirects in place for a long time. People may keep old bookmarks and links for years.
If you restructure a whole site, make a list of old and new addresses before you launch the change.
Remove
Sometimes the right answer is to take the link out. If an external page is gone and nothing replaces it, delete the link and adjust the sentence around it. If an internal page was removed on purpose and nothing is equivalent, leave it as a proper “not found” page, and remove links that lead to it. In some cases, a page that is permanently gone can return a “410 Gone” status, which says the removal is deliberate, though a normal 404 is acceptable for most small sites.
A useful test: if a visitor arrives here, what would they hope to find? If you have something that satisfies that need, redirect or repair. If you do not, a clear error page is more honest than sending them somewhere unrelated.
Beware “soft” errors
Some sites show an error message to visitors but still tell browsers and search tools that everything is fine. These are sometimes called soft 404s. They can confuse search tools and make problems harder to find. If you use a content management system or custom error page, check that the page actually sends a proper error status as well as showing friendly text.
Missing images and files
Broken links are not limited to text. Images that fail to load, documents that return errors, and embedded videos that no longer exist all hurt the page. For images, make sure that each has a meaningful text description, since that text is what appears if the image cannot load and is also valuable for web accessibility. Check downloads such as PDFs after you rename or move files.
Preventing new problems
- Think carefully before changing a page’s address once it is published. If you must change it, set up a redirect at the same time.
- Use clear, stable addresses rather than ones containing dates or temporary words that may need changing.
- Before deleting a page, check what links to it from your own site.
- Keep external links to a sensible number, and favor stable sources.
- After a redesign or move, run a link check straight away.
A monthly routine
A modest routine usually does the job: run a link checker or click through key pages, review the list of error pages visitors reached, fix or redirect the most visited ones first, and add a note to your records. Prioritize by effect. A broken link on your contact page matters more than one in a five-year-old post.
Link maintenance is rarely exciting, but it is one of the clearest ways to show visitors that someone is looking after the site.