Custom 404 Page: What to Put on It, What to Leave Off

custom 404 page

A custom 404 page is the branded page your site shows when someone requests a URL that doesn’t exist. Design matters least. Two things decide whether the page works: the server must still send a 404 status code, and the page must get the visitor to a useful next page in one click. Get the status wrong and the nicest error page on the web becomes a soft 404 in Search Console. Get the routing wrong and it becomes a well-branded dead end. Below: what to put on the page, what to leave off, the set-ups that quietly break the status code, and how to test and monitor it.

What a Custom 404 Page Is, and the Rule That Comes First

Every response has two parts: the status code, which crawlers read, and the HTML body, which people read. Your error page changes the body. It must not change the status. Google’s documentation on how HTTP status codes affect Google Search says Google doesn’t use content from URLs that return a 4xx code, removes indexed URLs that return 404 or 410, and gradually crawls them less often.

The failure mode is the reverse: a friendly “page not found” message served with a 200 (success) code. Search Console’s Page indexing help describes a soft 404 as a page that “returns a user-friendly ‘not found’ message but not a 404 HTTP response code”, and recommends returning a real 404 for truly missing pages. Our soft 404 guide covers the wider problem; here the rule is simple. Design whatever you like, as long as the status stays 404 (or 410). For a refresher on the codes, see HTTP status codes every SEO should know.

Does It Help SEO?

Not directly. Google doesn’t use the content of a 4xx response, so the words on your 404 page don’t rank anything. Search Console’s own help says “404 responses are not necessarily a problem, if the page has been removed without any replacement.” Our 404 errors and SEO guide explains when they actually cost you.

The value is indirect, and comes from three places:

  • Recovered visitors. People who follow a broken backlink, an old bookmark or a mistyped URL land somewhere useful instead of leaving.
  • A way back in. Navigation and a few well-chosen links give visitors a next step. That is a user feature, not a ranking lever.
  • Avoiding self-inflicted damage. Done badly, an error page creates soft 404s, redirects that look like soft 404s, or an indexable “page not found” URL.

One telling detail: Google’s old help URL about custom 404 pages now redirects to its general HTTP status code documentation. For search engines, this is a status-code question first and a design question second.

What to Put on a Custom 404 Page

Build it in priority order. The first three items alone beat most error pages.

  1. A plain statement that the page doesn’t exist. One sentence, no blame. “We couldn’t find that page” beats “You typed the wrong address.” If you show the requested URL back to the visitor, escape it properly in your template; never print raw query strings onto the page.
  2. A search box. The most useful element, because the visitor already has an intent. WordPress themes add one with get_search_form(). Better still, pre-fill it with the words from the broken URL’s slug, so the visitor doesn’t have to retype what they wanted.
  3. Three to six relevant links. Pick them by section, not one list for the whole site. A missing URL under /blog/ should offer recent or popular posts; a missing URL under /products/ should offer top categories.
  4. Your normal header, navigation and footer. Visitors should know they are still on your site.
  5. A way to report the broken link (optional). A short form or email link turns visitors into free monitoring.

Stores can add bestsellers; service businesses, their main service pages and a contact link. Keep the total small enough that the right click is obvious.

What Not to Put on It

Most bad 404 pages fail through additions, not omissions:

Don’t Why it hurts Do instead
Auto-redirect to the homepage after a countdown Turns the 404 into a redirect to an irrelevant page, which Google says “might be treated as a soft 404” Stay on the 404 and offer links
Redirect to a /page-not-found/ URL that returns 200 Every missing URL becomes a redirect to one success page: a soft 404 pattern, plus an indexable error page Serve the custom content at the requested URL with a 404 status
Keyword-heavy copy “for SEO” Google doesn’t use 4xx content, so it does nothing Write for the lost visitor
Hundreds of links or a full sitemap dump Buries the one link the visitor needed Three to six links matched to the URL section
Pop-ups, email gates, autoplay video Adds friction for someone who is already frustrated A search box and a clear message
Heavy images, scripts and animations 404s are requested often by bots and old links; a heavy page wastes bandwidth on every miss Keep it about as light as a normal content page

The redirect row is the important one. Google’s site move documentation warns against redirecting many old URLs to “one irrelevant single URL destination, such as the home page”, because it “can confuse users and might be treated as a soft 404 error.” A 301 is right only when a specific, equivalent replacement exists.

404 Page Design: Useful Beats Cute

Humour and illustration are fine if they don’t push the search box and links below the fold on a phone. Apply the one-click test to any 404 page design: can a visitor reach a page that probably answers their question with one click or one search? If the artwork fills the first mobile screen, no.

A worked example: someone follows an old forum link to a retired post at /blog/keyword-research-tips-2019/. A weak page shows a big illustration, “Oops! Lost in space”, and a homepage button. A strong one says “We couldn’t find that page”, pre-fills the search box with “keyword research tips” from the slug, and lists four posts from the same topic under the normal blog navigation. It also logs the hit, so someone can later redirect that URL to the right post. The visitor is one click from an answer, and you learn a broken link exists.

Accessibility applies too: a real heading, readable contrast (try our Color Contrast Checker), a labelled search field, and text that works without the image.

The Status-Code Trap: How Error Pages Become Soft 404s

The page looks right in a browser, so nobody notices when configuration changes the status code. The common culprits:

  • Apache with a full URL. The Apache ErrorDocument documentation warns that if the directive points to a remote URL (anything starting with http), the server sends a redirect and “the client will not receive the original error status code.” Use a local path such as ErrorDocument 404 /errors/404.html instead.
  • Nginx response-code overrides. The nginx error_page directive can replace the status with the =response syntax. A config written as 404 =200 deliberately serves the error page as a success. With a bare =, nginx passes through whatever code the backend returns, so if your 404 script answers 200, so does the site.
  • Single-page apps. With client-side routing the server often returns 200 for every path and JavaScript draws the “not found” view. Google’s JavaScript SEO basics gives two fixes: a JavaScript redirect to a URL where the server responds with a 404, or adding a robots noindex meta tag to the error view.
  • “Use this page as my 404” settings. Some builders and plugins let you pick an ordinary page as the 404. Some serve it correctly; others redirect to it, or leave it indexable at its own URL. Check the status after switching it on.

Setting Up a 404 Page in WordPress

WordPress returns a proper 404 status for missing URLs by default, so problems usually come from themes, builders or plugins. Where you edit the page depends on the theme type:

  • Classic themes use 404.php. In the template hierarchy, WordPress looks for 404.php and falls back to index.php if it’s missing. The theme handbook shows the pattern: header, a “Not Found” heading, a short message, get_search_form(), footer. Edit it in a child theme so updates don’t overwrite your changes.
  • Block themes edit the 404 template in the Site Editor under Templates. Default themes usually list it under a name like “404” or “Page: 404”.

Two WordPress-specific cautions. First, avoid plugins whose main feature is redirecting every 404 to the homepage; that is the pattern Google warns may be treated as a soft 404. Second, log before you redirect: Rank Math’s 404 Monitor, for example, records which URLs return 404 and can capture referrers. Then add one-to-one 301s where a true equivalent exists; see WordPress redirects.

How to Test Your Custom 404 Page in Two Minutes

Never judge a 404 page by how it looks. Check the status code directly:

  1. Command line. Run curl -sI https://example.com/this-page-should-not-exist-7f3 on your own domain. The first line of the output should report 404 (or 410), with no redirect status and no location header.
  2. Browser developer tools. Open the Network tab, load a made-up URL, and check the status column for the document request.
  3. Search Console URL Inspection. Run a live test on a made-up URL. Search Console’s help suggests it for soft 404s; the screenshot shows what Google rendered.

Test more than one shape of URL: a deep path inside each major section, a URL with a file extension such as a missing image, and a URL with extra query parameters. Sites often route these through different rules. A crawler catches what spot checks miss: the SEO Rocket site audit runs a real crawler with JavaScript rendering and flags 404s, soft 404 candidates, redirect chains and broken internal links in one pass.

Track Who Lands on Your 404 Page, Then Fix the Source

Your error page also tells you which links are broken. Give it a unique page title, then build a GA4 Exploration with Page title and screen class, Page location and Page referrer. GA4 defines Page referrer as “the user’s previous URL”, so filtering on your 404 title shows the missing URLs and where visitors came from.

Pair that with Search Console’s Page indexing report. Its help recommends fixing “only 404 errors that you link to yourself or list in a sitemap”, a sensible triage rule. For each URL:

  • Restore the page if it was removed by mistake.
  • Redirect with a 301 to the closest real equivalent. Use the 301 Redirect Generator for the rules, and a redirect map if a migration caused the batch.
  • Leave it as a 404 or 410 when nothing equivalent exists, and remove internal links and sitemap entries that point to it.

Missing URLs with external backlinks come first, because a good redirect recovers those links (see link reclamation). SEO Rocket’s site audit lists each broken URL with the internal pages that link to it, so you know which sources to edit. It’s a playbook proven across 1,000,000+ ranking pages: fix the sources, and treat the 404 page as the safety net.

Frequently Asked Questions

Should a 404 page be noindex?

It doesn’t need to be if it returns a real 404, because Google doesn’t index 4xx responses. A noindex tag is harmless as a backup, and for single-page apps that can’t send a 404 status, Google recommends it.

Should I use 410 instead of 404?

Google’s documentation describes 404 and 410 in the same terms: both tell Google the content doesn’t exist. Use 410 to signal a deliberate removal. One error page can serve both.

Can I redirect all 404s to my homepage?

You shouldn’t. Google says mass redirects to an irrelevant page like the homepage may be treated as soft 404s. Redirect only to true equivalents.

Beyond normal navigation, three to six links for the section the visitor wanted, plus a search box.

Build the page once, test the status on every URL shape your site serves, then spend your effort on the broken links that send people there.

Questions? Chat with us