Fixing a broken link: update, redirect or remove
Where the dead link sits decides the fix. A link on your own page is yours to change. A link on someone else's page isn't, so you answer it with a redirect. A link to a page that's gone for good usually needs to come out.
Start by asking what went wrong
Common causes of 404 responses, says MDN, are mistyped URLs or pages that are moved or deleted without redirection.1 So look at the dead link and ask three things. Is the address mistyped? Did the page move? Is it gone?
Open the address in a browser and look closely. A missing letter or an extra slash is a quick win.
The fix for each case
| Situation | Usual fix |
|---|---|
| Typo in the link | Correct the address on your page. |
| Your own page moved, and the link is on your site | Update the link to the new address. |
| Your own page moved, and links to it sit on other sites | Add a permanent redirect from the old address. |
| Another site moved its page | Find the new address and update your link. |
| Another site's page is gone | Link to a different source, or remove the link. |
| Your page is gone and nothing replaces it | Remove the links to it. |
Update your own links first
If the link is on your own pages, change it so it points straight to the new address. MDN says to try to avoid having internal redirects, and that if you can avoid one by correcting internal links, you should fix those links instead.2
Why bother, when a redirect would do the job? Because every redirect is an extra step, and a plain link has none.
Redirect for the links you can't change
You can't edit links on other websites, printed flyers or bookmarks. MDN puts it plainly: you have no control over the URLs used by external resources.2
For those, add a redirect. Google's Search Console help gives the rule for a moved page: use a 301 redirect to the new location.3 The page on 301, 302, 307 and 308 codes explains why that's the one to pick.
Before you change a redirect setting on your host or server, note down the settings that are there now. Follow your own host's help pages, as every host words these screens differently. Afterwards, open the old address and check that it lands on the right page.
When another site's page has gone
Sites you link to can move or vanish. Wikipedia lists causes such as a domain name's registration lapsing or being transferred to another party.4
You have a few choices.
- Search for the page's new address and update your link.
- Swap in a different page that covers the same point.
- Link to a saved copy. Wikipedia mentions linking to web archives such as the Internet Archive as one strategy against link rot.4
- Remove the link and reword the sentence so it still makes sense.
Pick the page you'd be happy to send your reader to. If the old link was the only source for a claim, think about whether you still want to make that claim.
When your own page is gone for good
Sometimes nothing replaces a deleted page. MDN says website owners should remove or replace links that return a 410, the code for a page that's no longer available, likely for good.5 Taking out the links on your own pages is the tidy answer.
You don't have to redirect it. Google's help says a 404 isn't necessarily a problem for a page removed with nothing to replace it.3 For more on that choice, read redirect or error page.
Check your work
After each fix, test the link again. Click it from the page where it lives. Then rerun whatever check found it, using the methods in the checking guide. A fix that you haven't tested is only a guess.
Reference list
- 404 Not Found, MDN Web Docs (Mozilla)
- Redirections in HTTP, MDN Web Docs (Mozilla)
- Page indexing report, Google Search Console Help
- Link rot, Wikipedia
- 410 Gone, MDN Web Docs (Mozilla)