What a helpful custom 404 page includes
A good "page not found" page does one job. It tells the visitor what happened and shows them where to go next. Without that, visitors can have a poor experience1.
Why does my error page matter?
Errors on a website can lead to a poor user experience for visitors1. You can't remove every broken link, so the page they land on is your chance to win them back.
What should the message say?
Tell visitors clearly that the page they're looking for can't be found. Google also suggests friendly, inviting language2. Something like "We can't find that page. It may have moved or been removed" does the job.
You can add personality. Feel free to make your 404 page humorous and human, but don't confuse your visitors as to why they are seeing something unexpected1. A joke is fine. A joke that hides the fact that something went wrong isn't.
What else belongs on the page?
Think of someone who arrived at the wrong door. They need a way back inside.
- Your normal look and menu. The 404 page should have the same look and feel, including navigation, as the rest of your site2. Visitors then know they're still on your site.
- A link to your home page. Many sites also add a search box3.
- Links to popular pages. Google suggests links to your most popular articles or posts2. For a small business, that might be your services, prices and contact pages.
- A way to report the problem. Think about providing a way for users to report a broken link2. A short email link or form works.
Some content systems have extensions that try to guess the page a visitor wanted and suggest it3. That's an extra, not a must.
What should I leave off?
Keep it short. Don't bury the message under a huge menu, a pop-up or a sales pitch. Don't blame the visitor, and don't use technical wording such as "HTTP error". You can mention the number once, in a small line, for anyone who wants to report it.
Does the page also need to send a 404 code?
Yes, and it's easy to miss. Custom 404 pages are made for users, so make sure the server returns a 404 HTTP status code2. Otherwise the page may count as a soft 404, and search engines may treat it like a real page.
Your host or website builder usually has a setting for the error page. On some servers, you point to a file. MDN notes that a common approach is to name the file 404.html or 404.php, at the top level of the server, depending on the technology1. If you use a builder, look for a "404 page" option in its help pages, and follow its instructions for your plan.
After setting it up, test it. Type an address that can't exist, such as your domain followed by a nonsense word. You should see your new page. To confirm the code too, use a status checker, or the live test in a search report.
Where does a 404 page fit in the bigger picture?
It's a safety net, not a substitute for fixing links. Find the dead ones with a site-wide link check. Learn what causes them in why links break. The wider background is in the explainer on the error itself, which cites the same MDN page1.
Reference list
- 404 Not Found, MDN Web Docs
- Troubleshoot Google Search Crawling Errors (soft 404 errors), Google Search Central
- HTTP 404, Wikipedia