Short answer: A custom 404 page should do two things at once: return an HTTP 404 (or 410) status code so search engines know the page does not exist, and help the human visitor continue with a clear message, a search box, navigation and links to key pages. Do not redirect missing URLs to the home page and do not serve the error page with a 200 status, because both create soft 404s. Test the status code directly and track which URLs land on the page.
What a 404 page is for
Every website has missing URLs. Pages get deleted, products are discontinued, people mistype addresses and other sites link to URLs that never existed. A 404 response is the correct and normal way to say “there is nothing here”. Search engines expect it, and a reasonable number of 404s does not harm a site’s rankings.
The error page therefore has two audiences with different needs:
- Crawlers only care about the status code. A 404 or 410 tells them to drop the URL from the index over time and stop spending effort on it.
- Visitors care about what to do next. They arrived with an intention, and a dead end means they leave.
Most 404 problems come from mixing these up: making the page friendlier for users by changing the status code, or satisfying crawlers with a bare server error page that loses every visitor.
Get the status code right first
The single most important technical detail is that the response to a missing URL has status 404 (Not Found) or 410 (Gone). The page content can be anything you like. Our overview of HTTP status codes for SEO explains the wider family of codes.
| Setup | Status returned | Result |
|---|---|---|
| Custom error page served for missing URLs | 404 | Correct |
| Deliberately removed page | 410 | Correct, states removal is intentional |
| Error page shown but status is 200 | 200 | Soft 404, missing pages may be indexed |
| All missing URLs redirected to home page | 301 then 200 | Usually treated as soft 404, confusing for users |
| Missing URLs redirected to /404/ page | 302 then 404 | Works poorly, loses the original URL in the address bar |
The last row is a common legacy setup. Serve the error page directly at the requested URL instead, so the visitor still sees the address they typed and can correct it. The soft 404 guide covers how search engines detect the problematic variants.
How to set it up on common platforms
Most platforms already return a proper 404; the work is in the template, not the server.
- WordPress: the theme’s
404.phptemplate controls the page. The status code is set by WordPress automatically when no content matches the URL. - Apache:
ErrorDocument 404 /errors/404.htmlserves a custom page with the correct status, as long as you use a local path and not a full URL, which would trigger a redirect. - Nginx:
error_page 404 /404.html;works the same way. Keep the error page itself reachable internally. - Static site hosts: most look for a file named
404.htmlin the root and serve it with a 404 status. - Single-page applications: the server often returns the app shell with 200 for every path. For unknown routes, either return 404 from the server or add a
noindexrobots meta tag in the rendered error view. See JavaScript SEO basics for how rendering affects this.
E-commerce and CMS plugins sometimes add their own “helpful” behaviour, such as automatically redirecting missing URLs to a guessed match. Check what yours does, because guesses are often wrong.
What to put on the page
A helpful 404 page is short. Its job is to get the visitor moving again within a few seconds.
- A plain message such as “We can’t find that page”. Avoid technical jargon and avoid blaming the visitor.
- Your normal header and navigation, so the page feels like part of the site and every main section is one click away.
- A search box, ideally pre-filled with words from the requested URL when that is easy to do.
- A few key links: popular categories or services, the blog, pricing and contact. Choose based on what visitors most often want.
- A way to report a broken link, if you have the capacity to act on reports.
Humour and illustrations are fine if they match your brand, but they should not push the useful elements below the fold on mobile.
Adapting the page to your type of site
The best links to offer depend on why people usually arrive at a missing URL on your site.
- Online shops: missing URLs are often discontinued products. Link to the main categories and a search box, and consider showing bestsellers. For product pages that are temporarily unavailable, keep the page live instead of returning 404.
- Service businesses: visitors usually want a service or a way to get in touch. Show the main services and a direct contact link or phone number.
- Blogs and publishers: offer search, the main topic categories and a few recent or popular articles.
- Software products: old documentation URLs are a frequent cause. Link to the documentation home, the changelog and support.
Whatever you choose, keep the list short. Five well-chosen links help more than a full sitemap on the error page.
Technical details that are easy to miss
- Keep it light. The 404 template is loaded for every mistyped URL and every bot probing random paths. Heavy scripts and large images waste server resources.
- Do not list it in the sitemap. An error page is not content. A URL like
/404/that returns 200 is a soft 404 in itself. - Use relative links carefully. Because the page is served at many different paths, relative links like
images/logo.pngbreak at deeper URLs. Use root-relative paths. - Localise it. On multilingual sites, show the error page in the language of the folder the visitor requested.
- Handle assets differently. A missing image or script should get a plain 404, not a full HTML page, to save bandwidth.
- Canonical tags: do not add a canonical pointing to the home page. The page is not meant to be indexed at all.
How to test your 404 setup
Do not trust the browser alone, because it shows the page content but not the status code. Test like this:
- Request a URL that certainly does not exist, such as
/this-page-should-not-exist-123/, with a tool that shows headers, for examplecurl -Ior your browser’s developer tools on the Network tab. - Confirm the first response is 404 or 410, with no redirect before it.
- Repeat with a missing URL in each main section: a blog post, a product, a category and a language folder, because different templates can behave differently.
- Use the URL Inspection tool in Search Console on one missing URL to see how Google reads the response.
- Check that a mistyped parameter on a real page, such as a wrong product ID, also returns 404 rather than an empty 200 template.
Use the 404 page as a data source
The error page tells you where visitors get lost. Give it a distinctive page title so it is easy to filter in analytics, and review the requested paths regularly.
- URLs with external referrers point to broken backlinks. If the target moved, a 301 redirect recovers both visitors and link value.
- URLs with internal referrers are broken links on your own site. Fix the link at the source; finding and fixing broken links describes the process.
- Frequent mistypes of a real URL can be redirected, if the intent is clear.
- Random probing paths from bots can be ignored.
This review is where redirects belong: selectively, for URLs with a clear successor, as explained in 301 vs 302 redirects. Everything else can stay a 404.
How Site SEO AI Audit helps
Site SEO AI Audit crawls your site the way a search engine does and records the status code of every URL it reaches. It reports broken internal and external links, links that go to redirects, redirect chains and pages that return errors, so you can see where your own site sends visitors to a 404. It checks status codes and links; it does not judge how your error page looks. You can run a free audit of your website to see the current state.
Related reading
- How to Remove a Page From Google Search, Step by Step
- Redirect Chains and Loops: How to Find and Fix Them
- Out-of-Stock and Discontinued Products: What to Do for SEO
The bottom line
A good 404 page returns a real 404 or 410 status and helps visitors continue with navigation, search and a few key links. Avoid soft 404s from 200 responses and blanket redirects to the home page. Test the status code with a header tool, keep the page light and localised, and use the list of requested URLs to fix broken links and redirect only what has a clear successor.
BUJ
Do 404 errors hurt SEO?
No, not in themselves. Search engines expect missing pages and simply drop them from the index. Problems arise when important pages return 404 by mistake or when internal links point to missing URLs.
Should I redirect 404 pages to the home page?
Generally no. Search engines usually treat such redirects as soft 404s, and visitors do not find what they wanted. Redirect only URLs that have a clearly relevant replacement.
What is the difference between 404 and 410?
A 404 means the page was not found, while 410 means it was removed on purpose and will not return. Both lead to removal from the index, and 410 may be processed slightly faster.
Should my 404 page have a noindex tag?
If it returns a real 404 status, a noindex tag is unnecessary because error responses are not indexed. It can help as a safety net on JavaScript sites where the server returns 200 for every route.
How can I check the status code of my 404 page?
Request a non-existent URL with curl -I or look at the Network tab in browser developer tools. The first response should show 404 or 410 without any redirect.


