A custom 404 page is a branded error page that appears when someone opens a URL that does not exist on your site. It does two jobs: it keeps a lost visitor on your site with a search box and useful links, and it answers search engines with the correct HTTP status, 404 Not Found.
What is a custom 404 page?
Every web server has a default error page in plain text. A custom 404 page replaces it with your design, your navigation and some guidance. The look is up to you. The status code is not: the server must send 404 (or 410 Gone for content you removed on purpose) in the response header, even though the page itself displays normally.
Why does a 404 page matter for SEO?
Google’s documentation says all 4xx errors except 429 are handled the same way: Google’s crawlers tell the next system that the content does not exist, and a URL that was indexed gets removed from the index. Newly found 404 URLs are not processed, and Google visits them less as time passes. Google’s page on this does not mention a ranking penalty for having 404s. A few 404s on a healthy site are normal and harmless.
The risk sits in two places:
- Soft 404s. If the error page returns
200 OK, Google sees a successful page with error content. Search Console reports it as a soft 404, and Google may keep crawling a URL that should disappear. - Dead ends for people. A visitor who clicked an old backlink and finds a blank error leaves. A useful 404 page gives them somewhere to go.
The 404 page is a safety net. The real work is fixing the broken links that lead to it.
What should a good 404 page contain?
- A plain message that says the page was not found, in your brand voice.
- A search box, so the visitor can look for what they wanted.
- Links to your main sections and your most useful pages: popular articles, product categories, contact. The same header and footer as the rest of the site work well (see site navigation).
- A path home, such as the logo link.
- A way to report the problem, such as a contact link, if you have staff to read the reports.
Keep it light: the page should load fast and carry no heavy scripts.
How do you set up a custom 404 page, step by step?
- Create the page. In WordPress add a
404.phptemplate or use your theme’s 404 setting. Static hosts such as Netlify, Vercel, Cloudflare Pages and GitHub Pages look for a404.html(or the framework’s equivalent) in the build. Shopify, Wix and Squarespace have a built-in editable 404 page. - Design it with the shared layout: header, footer, search box, five to ten links to your best content.
- Check the status code. Open a made-up URL such as
https://yoursite.com/this-page-does-not-exist-123, then look in DevTools (Network tab) or runcurl -Ion it. The first line must read404. If it reads200, fix your server or framework setting. - Do not redirect all missing URLs to the homepage. A blanket redirect hides the error from Google, and visitors land on a page they did not ask for. Redirect only when a real replacement exists, with a 301 redirect to the closest matching page.
- Use 410 for content removed for good, if you want a firm signal. Google treats 404 and 410 alike for Search, so this is optional.
- Keep the URL as it was typed. Show the error at the requested address and do not redirect to
/404/. A redirect to an error page that returns 200 creates a soft 404. - Keep it out of the sitemap. Never list the 404 page in your XML sitemap, and do not link to it.
- Fix the sources. Use the report below to find which links feed the 404 page, then repair or redirect them.
How do you measure the result?
Open the Page indexing report in Google Search Console and look at the reasons “Not found (404)” and “Soft 404”. Soft 404s are the ones to clear: click through, test the URL, and either return a real 404 or fix the page so it has genuine content. The crawl and indexing errors method explains how to read the report. For 404s that have inbound links, a crawl (Screaming Frog) shows which internal pages link to them. External links to dead URLs are worth a redirect, which also recovers the link value.
Also watch your analytics: the number of sessions landing on your 404 page, and where they go next, tells you if the page helps.
What mistakes should you avoid?
- Returning 200 on the error page. This is the number one mistake, and the one that creates soft 404s.
- Redirecting every dead URL to the homepage.
- Thin or empty pages that look like errors while returning 200, such as an empty category. Return a real 404 or put real content on the page.
- Linking to 404 URLs internally. Your own links should never lead to the error page. Run a crawl each month.
- Jokes without help. A funny illustration is fine, but the visitor still needs a search box and links.
- Indexing the 404 page or listing it in your sitemap.
Where can you learn more?
The free digital marketing module of the Fe/male Switch startup school covers site health checks for new startups. Next steps on SEO100: find and fix your broken links, then strengthen your internal linking so lost visitors have routes to good pages.