WordPress automatically shows your theme's 404.php template (classic themes) or its 404 block template (block themes) whenever a visitor hits a broken link.
To customise it you have three options: add a 404.php file to a child theme, edit the 404 template in the Site Editor, or install a plugin such as 404page to turn any Page into your 404. All three serve a correct HTTP 404 status.
What the WordPress 404 page is
A 404 page is what a visitor sees after following a broken, mistyped, or out-of-date link. WordPress has a built-in one, but most themes ship a cold, generic version — a bare "Oops! That page can't be found" with a search box. That page quietly loses visitors who would have stayed if they had a clear way back.
How you customise it depends on which kind of theme you run. Classic themes (the long-standing model — Astra, GeneratePress, most older themes) use PHP template files. Block themes (Twenty Twenty-Four, Twenty Twenty-Five and other full-site-editing themes) are edited visually in the Site Editor. Check under Appearance › Themes — if you see an Editor item under Appearance, you have a block theme.
Method 1 — Add a 404.php template (classic themes)
WordPress's template hierarchy looks for a file named 404.php in your active theme and uses it for every missing page automatically. You never have to wire it up — you just have to create it in the right place.
Create a child theme
Never edit your theme's files directly — the next theme update will erase your work. A child theme is a small folder that inherits everything from the parent but lets your changes survive updates. Create the folder wp-content/themes/yourtheme-child/ with two files.
style.css
/*
Theme Name: Your Theme Child
Template: yourtheme
*/
The Template value must exactly match the parent theme's folder name. Then add a functions.php that loads the parent's styles:
functions.php
<?php
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
} );
Activate the child theme under Appearance › Themes.
Add your 404.php file
Create 404.php inside the child theme folder. Here is a clean, working starting point that keeps your site's header and footer and gives the visitor real ways forward:
wp-content/themes/yourtheme-child/404.php
<?php
/**
* 404 — Page Not Found template
*/
get_header(); ?>
<main class="error-404">
<h1>We can't find that page</h1>
<p>The link may be broken, or the page may have moved.</p>
<?php get_search_form(); ?>
<p>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
Back to the homepage
</a>
</p>
<h2>Popular pages</h2>
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</main>
<?php get_footer(); ?>
Upload the file (via SFTP, your host's file manager, or Appearance › Theme File Editor). WordPress now serves it for every broken link — no settings to change.
Style and extend it
Add CSS to the child theme's style.css, and build out the page so it actually helps: a site search, your main navigation, links to your most popular sections, and a touch of personality that matches your brand. A 404 page is a real design surface — treat it like one.
Method 2 — Edit the 404 template in the Site Editor (block themes)
If you run a block theme, there is no PHP to touch. The 404 page is a template you edit visually.
Open the 404 template
Go to Appearance › Editor › Templates. Find the template named 404 (sometimes shown as "Page: 404"), and click it to open the block editor.
Design it with blocks
Edit it like any page: add a heading, paragraph, a Search block, a Navigation block, and a Columns block linking to popular content. You can drop in a Cover block or an image for visual interest. Everything you place here renders for every missing URL.
Save
Click Save. The new 404 template is live immediately — block themes need no child theme for template edits, because your changes are stored in the database, not in theme files.
Want full control over markup? Block themes also accept a templates/404.html file inside the theme folder. If you ship a custom block theme, that file becomes the default 404 template.
Method 3 — Use a plugin (no code)
If you would rather design your 404 page as an ordinary WordPress Page — with your page builder, your blocks, your layout — use a plugin that maps a Page to the 404 response.
- Install 404page – Your Smart Custom 404 Error Page from
Plugins › Add New. - Create a normal Page with the content and design you want.
- Under
Appearance › 404 Error Page, select that Page as your 404.
The plugin intercepts missing URLs and serves your chosen Page with a proper 404 status header — which a plain published Page on its own would not do. SEO-focused builders such as SeedProd and Elementor Pro offer similar 404-template features.
Do not just redirect 404s to your homepage. It is a common "fix" that creates a soft 404 — a missing page that returns a 200 OK status. Search engines treat that as a quality problem, and the visitor lands somewhere confusing with no explanation.
Make sure your 404 page returns a real 404 status
A correct 404 page must return the HTTP status code 404. WordPress's 404.php template and the block 404 template both do this automatically. The status only goes wrong when something else intercepts the request first — a redirect plugin, a caching rule, or a "redirect all unknown URLs to home" setting.
To check: visit a URL you know does not exist, like yoursite.com/this-page-is-not-real. It should show your new 404 design. Then confirm the status code — open your browser's developer tools, go to the Network tab, reload, and look at the status of the first request. It must say 404. If it says 200, you have a soft 404 — see our guide to fixing soft 404 errors.
What makes a WordPress 404 page actually good
Getting the template in place is the easy part. A 404 page earns its keep only if it does the job: turning a dead end into a recovery. The best ones share a clear anatomy — they orient the visitor ("this page is missing, here's why"), offer real escape routes to popular content, include working site search, suggest pages the visitor probably meant, and carry the brand's voice instead of an apologetic shrug.
We break down all twelve traits the strongest 404 pages share on the main page. The short version: a 404 page is a design and copywriting surface, not an error message — so write and build it like one.
Skip the blank page — generate it
Enter your WordPress site and get a complete, on-brand 404 page tailored to your real colours, fonts, and navigation — with the 404.php or block markup ready to paste in.
Free · no account · no opt-in
Frequently asked questions
Where is the 404 page in WordPress?
In a classic theme it is the 404.php file inside your active theme folder. In a block theme it is a "404" template you edit under Appearance › Editor › Templates. If neither exists, WordPress falls back to index.php and shows a generic "Nothing found" message.
Do I need a plugin to customise the WordPress 404 page?
No. You can edit the theme template directly — 404.php for classic themes, the 404 block template for block themes. A plugin is only worth it if you want to design the 404 page as a normal Page using your page builder, without touching theme code.
Why does my WordPress 404 page return a 200 status?
That soft 404 almost always comes from a redirect: a plugin or rule sends unknown URLs to the homepage with a 200 or 301 status, so WordPress never gets to serve its own 404 template. Remove that redirect and let WordPress handle missing pages itself — its 404 template returns the correct status.
Will editing 404.php break when my theme updates?
Only if you edit the parent theme directly. Put 404.php in a child theme and theme updates will never overwrite it. Block-theme template edits are stored in the database, so they are safe from updates automatically.
Does this work on WordPress.com?
This guide covers self-hosted WordPress (WordPress.org). On WordPress.com, custom 404 editing depends on your plan — Business and Commerce plans allow theme and plugin changes; lower tiers offer limited control. Block-theme template editing in the Site Editor is the most widely available route there.