Production

Write your 404 page for the context you broke

Most 404 pages say the same thing no matter how someone landed there: "Page not found. Here's a search box." That ignores the context. A user who clicked an internal link expects different help than someone who mistyped a URL or followed a stale bookmark.

You can't fix every broken link, but you can write 404 copy that acknowledges how the link broke.

Detect the referrer and adjust the message

If the referrer is your own domain, the user clicked a link you published. Your 404 should say so:

This link shouldn't be broken.
You clicked a link on our site that points to a page we can't find. We've logged this error and we'll fix the link. In the meantime, try our site map or homepage.

That tells the user it's your mistake, not theirs, and that you're tracking it. It also skips the search box—if they clicked an internal link, they weren't trying to search.

If there's no referrer, or the referrer is external, assume they typed the URL, followed an old bookmark, or clicked someone else's outdated link:

We can't find that page.
The URL might be mistyped, or the page may have moved. Try searching our site or start from the homepage.

This version offers a search box because the user might know what they're looking for but not where it lives now.

Log the broken internal links

When your own site generates a 404, log the referring page and the broken target URL. Most server logs and analytics tools already capture this, but you need to review it. A broken internal link is a production error—you published a link that doesn't resolve. Fix it the same day if you can.

External 404s matter less unless you see patterns. If a dozen users arrive at /old-services from external search results, you probably renamed or deleted a page without setting up a redirect. That's a separate fix (write the redirect rule and republish), but the 404 page isn't the place to explain it.

Don't apologize or joke

Skip "Oops!" or "Uh-oh, something went wrong." The user doesn't need reassurance that mistakes happen. They need a next step. And don't write clever jokes about missing pages unless your entire site is joke-forward. A user who just lost their place in a task won't appreciate the levity.

Write the message in the same voice you use everywhere else. If your button text is direct and your error messages are specific, your 404 should match.

Test both scenarios

Publish a draft post with a broken internal link and click it. You should see the internal-referrer version of your 404. Then type a nonsense URL directly into your browser. You should see the no-referrer version.

If your CMS or CDN doesn't let you customize 404 pages by referrer, write the no-referrer version and log internal 404s separately. At minimum, don't pretend the user made the mistake when your site generated the bad link.

A 404 page is interface copy. It's part of your content model, not a branding exercise. Write it for the context that triggered it, and fix the internal breaks as soon as they surface.

← All posts