Somebody clicks a link to your site and lands on a blank screen that says “Nothing found.” Then they leave. Akamai research puts that number at 44% of visitors abandoning a site after one 404.

Knowing how to create a custom WordPress 404 error page turns that dead end into a search box, a menu, and a few relevant links.

This guide covers all four methods and the parts most tutorials skip:

  • The Site Editor, a 404.php child theme file, page builders, and plugins
  • Confirming the page still returns a real 404 status code instead of a soft 404
  • Finding broken URLs in Search Console, GA4, and Ahrefs
  • Deciding between a 301 redirect, a 404, and a 410

What Is a WordPress 404 Error Page

A WordPress 404 error page is the template WordPress serves when a requested URL matches no post, page, product, or archive in the database. The server returns an HTTP 404 Not Found status code, and the active theme renders whatever markup sits in the 404 template.

The status code and the design are two separate things. Confusing them is where most custom builds go wrong.

The 404 template: theme-level, fires automatically for every dead URL on the site, no slug of its own.

A published page with the slug /404/: a normal WordPress page that returns 200 OK and gets indexed like any other page.

WordPress runs 41.5% of all websites as of July 2026 according to W3Techs, so the default error screen you have seen a thousand times is not a coincidence. It is the same handful of theme templates repeated across tens of millions of installs.

What the default looks like

Twenty Twenty-Four and Twenty Twenty-Five ship a bare block template: a heading, a short sentence, and a search form. Nothing else.

Have you seen the latest WordPress statistics?

Discover the latest WordPress statistics: market share, security trends, performance data, and revenue insights that shape the web.

Check Them Out →

Astra (over 1.8 million active installations) and GeneratePress (500,000+) do roughly the same through a classic 404.php file, inheriting the site header and footer.

Ahrefs runs a branded error screen on its own domain and uses it in its glossary entry on broken links, which tells you how seriously SEO tool vendors treat the page.

What “custom” actually changes

Custom means the layout, copy, branding, and internal links. It does not mean the status code.

A working custom 404 still returns 404. The moment it returns 200, you have built a soft 404, and Google flags it in the Page Indexing report.

Akamai research found 44% of users abandon a site after hitting a single 404. That number is the whole argument for doing this properly.

Why WordPress Returns 404 Errors

WordPress returns a 404 when the query finds no matching content and no rewrite rule resolves the requested path. Deleted posts, changed slugs, permalink structure edits, mistyped URLs, and stale external backlinks account for the overwhelming majority of hits.

Ahrefs analyzed links pointing to 2,062,173 websites since January 2013 and found 66.5% had rotted. Roughly 7% of backlinks disappear within the first year.

Cloudflare measured that over 1% of all page views crossing its global network end in a 404. On a site doing 100,000 monthly sessions, that is 1,000 people landing on a dead end.

CauseTypical triggerWhere to check
Deleted contentTrashed posts, removed productsSearch Console Pages report
Changed slugsEditorial retitling, category cleanupRedirection plugin 404 log
Permalink structure changeRewrite rules not flushedSettings → Permalinks
Broken backlinksOld URLs still linked externallyAhrefs Broken Backlinks report

Case sensitivity and trailing slash mismatches produce a surprising share of the log. /About-Us/ and /about-us/ are two different URLs on most Linux servers.

Plugin and theme conflicts break custom post type archives too. Registering a CPT without flushing rewrite rules gives you a 404 on an archive that clearly exists in the admin.

If the whole site suddenly throws 404s on every URL except the homepage, that is almost always a permalink issue rather than missing content. Resaving the permalink settings regenerates the rules.

For the diagnostic side of things, the process of tracking down and repairing individual 404 responses runs parallel to building the page itself. Same for cleaning up dead internal links across old posts.

How WordPress Chooses Which 404 Template to Load

WordPress checks is404(), then walks the template hierarchy in a fixed order. Block themes load templates/404.html, classic themes load 404.php from the child theme first and the parent theme second, and index.php catches anything left over.

Theme typeFile loadedEditable from
Block themetemplates/404.htmlAppearance → Editor
Classic theme404.php (child, then parent)Code editor or SFTP
Neither file presentindex.phpCode editor or SFTP

Block theme adoption is still in single digits across the install base according to 2026 HTTP Archive readings, which means most sites reading this are running classic themes with a 404.php somewhere.

The header is separate from the template. WordPress sends the 404 status code through statusheader(404) before the template renders, so editing the file never changes the response code.

Editing 404.php inside the parent theme gets your work wiped on the next theme update. Astra shipped release v4.13.6 in July 2026 alone, and every one of those updates overwrites parent theme files.

The difference between a template file and a theme matters here, and it is worth reading up on how WordPress separates templates from themes before touching either.

What a Custom 404 Page Includes

A working custom 404 page includes a search form, primary navigation, 3 to 6 popular post links, plain-language copy, and a route back to human help. Everything else is decoration.

Cludo benchmark data puts the average bounce-rate reduction from a well-built error page at 12%. Cloudflare measured the same figure independently: over 12% of visitors hitting its SmartErrors replacement went on to engage deeper with the site instead of leaving.

Search form: the single highest-value element, since 46% of 404 traffic arrives from bookmarks, emails, and shared links where the visitor already knew what they wanted. Adding a functional search input to the template takes one block.

Navigation: the full menu, not a lonely homepage button. Sound site navigation structure gives people four or five exits instead of one.

Popular posts: 3 to 6 links pulled dynamically, not hardcoded. Hardcoded lists rot faster than the URLs that sent people here.

One clear next step: a single primary action for the visitor to take, whether that is search, browse, or contact support.

WooCommerce stores add product recommendations and a link to order tracking. BigCommerce UX research from 2024 found 74% of visitors leave and never return when the error page offers no recovery path, and on a store that is a lost transaction, not a lost pageview.

Keep the assets light. A full-width oversized hero image at the top of the layout and a Lottie animation on a page nobody intends to visit is wasted bandwidth, especially given only 43-45% of WordPress sites pass Core Web Vitals on mobile per HTTP Archive.

How to Create a Custom 404 Page in the WordPress Site Editor

The Site Editor edits the 404 template visually on any block theme running WordPress 6.0 or later. Go to Appearance > Editor > Templates > 404, add blocks, and save. No files, no FTP, no child theme.

WordPress 6.x now powers over 90% of active installs, so the editor is available on almost every modern site running a block theme.

Editing the 404 template with blocks

Path: Appearance > Editor > Templates > 404 > Edit.

The canvas loads the theme’s existing 404 template. Delete the placeholder paragraph, then build with Group, Heading, Paragraph, and Buttons blocks.

Everything saves as a template override in the database. The theme’s own 404.html file stays untouched on disk, which is why theme updates cannot destroy the work.

Anyone still on the classic editor needs to switch the block editor back on before any of this appears.

Adding a search block and popular posts query

Drop in a Search block first. Set the button label to something human (“Find it”) rather than the default.

Then add a Query Loop block, set post type to Post, order by date or comment count, and cap it at 4 items. The Query Loop pulls posts dynamically, so the list stays current without anyone maintaining it.

Watch the post template: strip it down to title and featured image. Full excerpts on a 404 page push the search form below the fold.

Reverting template changes

Template overrides are reversible. Open the 404 template, click the options menu, and choose Clear customizations.

WordPress deletes the database override and falls back to the theme file. No backup needed, which makes the Site Editor the safest of the four methods for experimenting.

The catch: classic themes without full site editing support show no Templates panel at all. Astra and GeneratePress users see the Customizer instead.

How to Create a Custom 404 Page with a 404.php Template File

Creating a 404.php file in a child theme gives complete control over the markup, the queries, and the assets loaded. Copy the parent theme’s 404.php into the child theme directory, edit it there, and WordPress loads the child version automatically.

This is the method that survives every theme update, every plugin deactivation, and every page builder license lapse.

Setting up the child theme

Create /wp-content/themes/yourtheme-child/ with a style.css carrying a Template header and a functions.php that enqueues the parent stylesheet.

Drop the copied 404.php into that folder. WordPress finds it before the parent file, no registration needed.

Anyone unfamiliar with editing the functions file safely should test on staging first. A missing semicolon here takes the whole site down.

Building the template markup

The skeleton is three calls and whatever sits between them:

<?php getheader(); ?> <section class="error-404"> <h1>That page has moved on</h1> <?php getsearchform(); ?> </section> <?php getfooter(); ?> `

Never add statusheader() here. WordPress already sent the 404 header before this file ran, and calling it again produces duplicate headers on some server configurations.

Pulling dynamic content into the template

wpnavmenu() renders the primary menu. wpgetrecentposts() pulls a live list of 4 recent articles.

File access: SFTP beats the built-in Theme File Editor every time, because a PHP fatal error saved through the admin can lock you out of the admin.

If the editor is missing from Appearance entirely, the file editor has usually been disabled by a constant or a security plugin. Managed hosts disable it by default.

The parent theme is off limits for a reason, and the same logic applies to deciding when core WordPress files are fair game. Which is almost never.

How to Build a Custom 404 Page with a Page Builder

Page builders assign a visually designed template to the 404 condition through a theme builder module. Elementor Pro, Divi, Beaver Themer, and Bricks all support this, and all of them handle the 404 status code correctly out of the box.

HTTP Archive data from the April 2026 crawl shows Elementor on 32.67% of WordPress sites, wpBakery on 8.52%, Divi on 5.7%, and Bricks growing 71.2% year over year from a small base.

BuilderWhere the 404 template livesCost
Elementor ProTemplates → Theme Builder → Error 404Pro only
DiviDivi → Theme Builder → Add New TemplateIncluded
Beaver BuilderBeaver Themer → Themer Layouts → 404Themer add-on
BricksBricks → Templates → Type: 404Included

Elementor Pro: create a Single template, set the display condition to Error 404, publish. The Theme Builder is the main reason people upgrade from free, and 404 templating sits behind that paywall.

Divi: the Theme Builder handles 404 as a standard template assignment. Divi holds a stable 5.5% to 5.9% of WordPress sites over three years, mostly through lifetime license holders.

Beaver Themer: a separate purchase on top of Beaver Builder. Themer Layouts include a 404 type with the same conditional logic as archives and singles.

Cost is the honest downside. Elementor’s free version has no Theme Builder, Beaver Themer is a paid add-on, and neither will admit that in the plugin description.

The other downside nobody mentions: builder-made 404 templates load the builder’s full CSS and JS payload. On a page that Googlebot hits thousands of times a month, that overhead is real.

How to Create a Custom 404 Page with a Plugin

A plugin maps an existing WordPress page to the 404 template without touching theme files. You design the page in the block editor, pick it in the plugin settings, and the plugin renders that content whenever a dead URL is requested while keeping the 404 status code intact.

No redirect happens. The visitor stays on the URL they requested, which is the whole point.

Smart Custom 404 Error Page: the successor to the original 404page plugin, which was retired in October 2023. Select any published or draft page, done in about 90 seconds.

SeedProd: ships a dedicated 404 page mode inside its landing page builder, useful if the site already runs SeedProd for coming-soon screens.

Rank Math: pairs a 404 monitor with a redirection module. Over 4 million active installations as of July 2026 according to WordPress.org, so a lot of sites already have this sitting in the admin unused.

AIOSEO: the redirects addon handles 404 logging and rules, with 3 million-plus installs behind it.

Keep the mapped page out of menus and out of the sitemap. Learning how to keep a page hidden from public listings matters here, because a page that ranks for its own URL becomes a duplicate of the error screen.

The abandonment risk is real. Roughly 59% of plugins in the WordPress.org directory (over 34,000) have gone more than two years without an update, and Patchstack reported 1,614 plugins removed from the repository in a single year over unpatched security issues.

Deactivate the plugin and the theme default returns instantly. Nothing breaks, but the design vanishes.

Which Method Fits Which Site Setup

Method choice comes down to theme type, budget, and who maintains the site. Block themes get the Site Editor, classic themes with a developer get 404.php, sites already running a builder use the theme builder, and hands-off client sites get a plugin.

MethodBest fitCostSurvives updates
Site EditorBlock themes, WordPress 6.xFreeYes
404.php in a child themeClassic themes, developer accessFree (time)Yes
Page builder templateSites already using Elementor or DiviPaid tierYes, while licensed
Plugin mappingClient sites, no code accessFreeYes, while maintained

Elementor sits on 32.67% of WordPress sites per the April 2026 HTTP Archive crawl, so for roughly a third of the install base the theme builder route costs nothing extra beyond the Pro license already paid for.

Block theme adoption remains in single digits across the same dataset. The Site Editor is the cleanest method and also the one fewest sites can actually use right now.

Agencies and freelancers: the child theme file wins on portability. Anyone running a portfolio of client installs can drop the same 404.php into every build.

Budget reality: a developer writing a custom template bills for an hour of work, and WordPress developer rates vary wildly by region and seniority. The plugin route costs nothing and gets 80% of the result.

How to Test That a Custom 404 Page Returns the Correct Status Code

Request a URL that cannot exist, then read the HTTP response header. Chrome DevTools, curl, httpstatus.io, and Screaming Frog all report the status code directly. A correct custom 404 returns 404. A broken one returns 200 and becomes a soft 404.

Use something deliberately absurd like /this-page-does-not-exist-9821/ so no plugin rewrite accidentally catches it.

Checking the response in the browser

Open DevTools, switch to the Network tab, load the test URL, and look at the Status column for the document request.

200 means the design works and the signal is broken. That single number is the difference between a working error page and an indexing problem.

Google’s own guidance names the same check: a page that shows “not found” text while returning 200 gets flagged as a soft 404 in the Page Indexing report.

Command line and bulk checks

curl -I https://example.com/this-page-does-not-exist-9821/ prints the header and nothing else.

httpstatus.io handles up to 100 URLs at once through a browser. Screaming Frog’s Response Codes tab filtered to Client Error (4xx) covers a whole site in one crawl and flags external dead links at the same time.

Search Console URL Inspection gives the third opinion, distinguishing “Not found (404)” from “Soft 404” on the live URL.

Caching plugins that mask the status code

This is the failure nobody tests for. WP Rocket documentation states plainly that any page returning 200 can be cached, which is exactly how a soft 404 gets served to thousands of visitors from a static file.

LiteSpeed Cache handles it differently, with a Default HTTP Status Code Page TTL set to 3600 seconds for 404, 403, and 500 responses out of the box.

WP Rocket’s own issue tracker documents high-traffic sites where a moderate volume of 404 requests consumed all available PHP workers and triggered 502 and 504 errors.

How to Find and Monitor 404 Errors

Search Console reports which dead URLs Google crawls, GA4 reports which ones real visitors hit, and a crawler finds the broken internal links producing them. Running all three catches errors that any single source misses.

Ahrefs sampled 2,062,173 websites and found 66.5% of links had rotted since January 2013, so the list never empties. Monitoring is a standing job, not a one-off cleanup.

Search Console Pages report

Go to Indexing > Pages and look for the Not found (404) row in the reasons table.

If that row is absent, Google has not encountered 404s on the site. Each URL expands to show referring pages, which is how you trace the source.

Analytics and tag manager

GA4 has no built-in 404 report. Two workarounds exist.

  • Filter Pages and screens by the 404 template’s page title
  • Fire a custom pagenotfound event carrying requestedpath and pagereferrer

The event approach gives cleaner data, and adding Google Tag Manager to the site makes the trigger a five-minute job with no code in the template.

Crawlers, logs, and backlink tools

Redirection plugin: over 1 million active installations, logs every 404 with hit counts, referrers, and user agents.

Ahrefs Site Explorer: the Broken backlinks report surfaces dead URLs that still hold external links, which is the highest-value slice of the list.

Server access logs show what the front end never sees. A sudden spike is usually a bot probing /wp-admin/ variants or missing favicon requests from browsers, not humans.

While auditing, watch for pages with no internal links pointing to them. Orphaned content and 404 clusters usually come from the same abandoned site restructure.

When to Redirect a URL Instead of Serving the 404 Page

Redirect when an equivalent replacement URL exists. Serve a 404 when nothing replaces it. Return 410 Gone when the content was deliberately deleted and will never come back, such as discontinued products or expired listings.

ResponseUse whenEffect on Google
301Direct replacement existsPasses link equity to the target
404No replacement, low valueDeindexed, then recrawled for months
410Permanently removed on purposeDeindexed faster, sends a clearer signal

John Mueller addressed this on Reddit in March 2026, saying repeated crawling of 404 URLs causes no problems and that a 410 will not stop the recrawling either.

Google’s crawl budget documentation is blunter about the alternative: soft 404 pages keep getting crawled and waste budget, while a proper 404 is a strong signal not to crawl that URL again.

Never bulk redirect everything to the homepage. One technical audit reported soft 404 detection triggering on roughly 85% of catch-all homepage redirects within 14 days.

Priority order: redirect dead URLs holding backlinks first, then those with organic traffic history, then leave the rest as 404s. Ahrefs data shows about 7% of backlinks vanish within the first year, so reclaiming them beats chasing new ones.

Structural changes cause most of this. Stripping /category/ out of permalinks or switching off archive pages entirely orphans every old URL at once, and each one needs a decision.

Errors That Break Custom 404 Pages

Six mistakes account for nearly every broken implementation: an indexable design page, a homepage redirect, missing noindex on the mapped page, edits to the parent theme, heavy assets, and a robots.txt block that hides the status code from Google.

Indexable 404 design: the page you built ranks in search for its own URL and competes with real content. Set it to noindex and keep it out of the sitemap.

Homepage redirect instead of a 404: the fastest way to manufacture soft 404s at scale, and the one Google’s documentation warns about by name.

Parent theme edits: Astra shipped 277 releases since joining the directory in 2017. Every one of them overwrites parent theme files.

Bloated assets: only 43-45% of WordPress sites pass Core Web Vitals on mobile per HTTP Archive, and loading a builder’s full CSS and JS payload on a page crawlers hit thousands of times a month makes that worse.

Blocking /404/ in robots.txt: Google’s crawl budget guidance notes that blocked URLs stay in the crawl queue much longer, so the block prevents confirmation of the status code without removing anything.

A syntax slip in 404.php produces a fatal PHP error on every dead URL rather than a design problem. The stack trace lands in the WordPress debug log, which is the first place to look when the template renders blank.

Test the whole thing quarterly. Request a nonsense URL, confirm the 404 header, click the search box, and check that the not-found screen still resolves correctly after the last round of theme and plugin updates.

FAQ on How To Create A Custom WordPress 404 Error Page

Does a custom 404 page hurt SEO?

No, as long as it returns a 404 status code. Google treats standard 404s as normal. The damage comes from soft 404s, where the page returns 200 while showing “not found” text.

Do I need a plugin to build one?

No. Block themes handle it through Appearance > Editor > Templates > 404, and classic themes use a 404.php file in a child theme. Plugins just save time for people without code access.

Should the 404 page be set to noindex?

The template itself needs nothing, since a 404 response already keeps it out of the index. Add noindex only when a plugin maps a published page, because that page has its own indexable URL.

Why does my custom 404 page return 200?

Usually a caching plugin or a redirect rule. WP Rocket caches anything returning 200, and catch-all redirects to the homepage produce the same result. Test with curl -I against a nonsense URL.

Can I redirect all 404s to the homepage instead?

Technically yes. Practically it is the worst option available. Google flags mass homepage redirects as soft 404s, and visitors who wanted a specific article get dumped somewhere useless.

What should the page actually contain?

A search form, the full navigation menu, and 3 to 6 popular post links. Skip the oversized hero image. Crawlers hit this template constantly, so keep the payload light.

Will a theme update wipe my work?

Only if you edited the parent theme. Site Editor changes save as database overrides, and child theme files sit outside the update path. Both survive every release.

When should I use 410 instead of 404?

Use 410 Gone for content you deleted on purpose and will never restore: discontinued products, expired listings, retired landing pages. Google deindexes 410s slightly faster and reads the signal as deliberate.

How do I find which URLs are throwing 404s?

Search Console’s Pages report lists the Not found (404) row with referring pages. The Redirection plugin logs live hits, and Screaming Frog’s Response Codes tab filtered to 4xx catches broken internal links.

Does the 404 template work with WooCommerce?

Yes. WooCommerce uses the theme’s 404 template like everything else. Stores usually add product recommendations and an order tracking link, since a dead product URL costs a transaction rather than a pageview.

Conclusion

Working out how to create a custom WordPress 404 error page takes an afternoon. Keeping it correct takes a recurring calendar entry.

Build it once in a child theme or the Site Editor, then treat verification as maintenance. Response codes drift quietly after plugin updates, server migrations, and permalink edits.

Three habits keep the template honest:

  • Check the response header in DevTools or httpstatus.io after any migration
  • Review the Search Console Pages report monthly and redirect dead URLs holding link equity
  • Confirm the Query Loop or recent posts list still renders after theme releases

The design matters less than the status code. Get 404 responses right and the rest is layout work.