Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Setup & site building · Guide

How to Change 404 Page in WordPress (Step by Step)

How to Change 404 Page in WordPress (Step by Step)

Short answer

On a block theme, go to Appearance, Editor, Templates and edit the Page: 404 template with blocks. On a classic theme, copy the 404 template file into a child theme and edit it, or use a plugin that sets a normal page as your 404 page.

Key takeaways

  • Block themes have a Page: 404 template in the Site Editor.
  • Classic themes use 404.php, best edited in a child theme.
  • Plugins can turn any normal page into the 404 page.
  • A good 404 page offers search, key links and a way home.
  • Always keep the real 404 status code to avoid soft 404s.

How do you change the 404 page in WordPress?

On a block theme, edit the Page: 404 template in the Site Editor; on a classic theme, edit 404.php in a child theme, or use a plugin or page builder to swap in a custom page.

A 404 page is what visitors see when they follow a link to an address that does not exist. Every WordPress theme includes one, but the default is often a bare Nothing found message.

A better 404 page keeps people on your site. It explains what happened, offers a search box and points to popular content instead of leaving visitors at a dead end.

Which method you use depends on your theme. Check under Appearance: if you see Editor, you have a block theme. If you see Customize and Widgets but no Editor, you have a classic theme.

Not sure of the difference? Our explainer on block themes versus classic themes sets it out.

Theme or toolWhere to change the 404 page
Block themeAppearance > Editor > Templates > Page: 404
Classic theme404.php in a child theme
Any themeA 404 page plugin that uses a normal page
Elementor ProTheme Builder, 404 page template

Method 1: Edit the 404 template in a block theme

Go to Appearance, then Editor, then Templates, open Page: 404, edit it like any page with blocks, and click Save.

The template already contains a heading, a short message and usually a search block. Click any block to change the text, or use the plus icon to add new ones.

The Learn WordPress tutorial on personalizing your 404 template walks through the same steps with video.

Good blocks to add include a Search block, a Latest Posts block, a list of links to key pages and a button back to the home page.

Your changes are saved to the database, not the theme files. If you ever want to start over, open the template's options and choose to reset it to the theme's default.

The header and footer template parts appear on the 404 page as normal. You only need to edit the content area in the middle.

Method 2: Edit 404.php in a classic theme

Copy your theme's 404.php file into a child theme, edit the copy, and upload it; WordPress will use the child theme's version.

Classic themes use the template hierarchy to pick files. When no content matches a request, WordPress loads 404.php. If that file is missing, it falls back to index.php.

Never edit the parent theme's files directly. Theme updates overwrite them, and your changes vanish. Our explainer on what a child theme is shows how to set one up.

A simple custom 404.php might look like this:

<?php get_header(); ?>
<main class="site-main">
  <h1>Sorry, that page is missing</h1>
  <p>The link may be old or mistyped. Try a search or visit one of the pages below.</p>
  <?php get_search_form(); ?>
  <ul>
    <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>">Home</a></li>
    <li><a href="<?php echo esc_url( home_url( '/blog/' ) ); ?>">Blog</a></li>
  </ul>
</main>
<?php get_footer(); ?>

Match the HTML structure and classes to your theme's other templates so the page looks consistent. Copying the parent's 404.php as a starting point is the safest way to do that.

Upload the file to the child theme folder over SFTP or your host's file manager, then visit a made-up address on your site to test it.

Method 3: Use a plugin to set a normal page as the 404

Install a plugin that lets you pick any page as your 404 page, then design that page in the block editor like any other page.

This is the easiest option for classic themes if you do not want to touch code. You build the 404 content as a normal page, then point the plugin at it.

Options in the directory include 404page and Page as 404. Check each plugin's page for recent updates and compatibility with your WordPress version before installing.

A good plugin still sends a 404 status code, even though the content comes from a normal page. Test that after setup, as explained below.

Hide the 404 page from your sitemap and site search. Visitors should only see it when a link is broken, not as a page in your navigation.

Method 4: Use Elementor Pro's Theme Builder

In Elementor Pro, go to Templates, then Theme Builder, add a 404 page template, design it and set its display condition.

Elementor Pro includes a dedicated 404 page type in its Theme Builder. You design it with widgets, just like any other Elementor template.

When you publish, Elementor applies it automatically to all 404 responses. Our guide on how to use Elementor templates covers the Theme Builder basics.

The free version of Elementor does not include Theme Builder. Free users can build a page with Elementor and use a plugin from Method 3 to set it as the 404 page.

What should a good 404 page include?

A clear message, a search box, links to your most useful pages and a way back home, all in your site's normal design.

Keep the message short and friendly. This page could not be found works better than technical jargon about server responses.

Include a search box. Many visitors know what they wanted and only need a way to look for it.

Add links to your top pages or categories. For a shop, link to bestsellers and the main product categories; for a blog, link to popular posts.

Keep the header and footer. A 404 page that looks like the rest of the site reassures visitors they are still in the right place.

A touch of personality is fine, but do not let a joke hide the useful links. The page's job is to get people moving again.

How do you keep the correct 404 status?

Make sure the custom page still returns a 404 HTTP status code, not a 200, so search engines do not treat missing URLs as real pages.

When a missing page returns 200, Google calls it a soft 404. Google's documentation on HTTP and network errors explains why soft 404s waste crawling and can confuse indexing.

Built-in theme templates always send the right code. Plugins and page builders usually do too, but check after setup.

To test, open your browser's developer tools, go to the Network tab, load a made-up address on your site and check the status of the first request. The MDN reference for 404 Not Found explains what you should see.

Never redirect every missing URL to the home page. It confuses visitors and is treated as a soft 404 by search engines too.

How do you reduce how often people see the 404 page?

Find broken links and redirect moved or deleted pages to the closest matching content with 301 redirects.

A nice 404 page is a safety net, not a fix. Each 404 means a visitor or a search engine followed a link that no longer works.

Check Google Search Console for pages reported as not found, and scan your own content for broken links. Our guide on how to find broken links in WordPress covers the tools.

When a page has moved, add a 301 redirect from the old address to the new one. Our guide on setting up 301 redirects walks through plugin and server methods.

If real posts suddenly return 404 errors, the problem is not your 404 page but your permalinks. See our fix for 404 errors on posts.

For the SEO side, our guide on fixing 404 errors for SEO explains which 404s matter and which you can safely ignore.

Why is my custom 404 page not showing?

The usual causes are caching, a child theme file in the wrong place, a plugin overriding the template, or server rules that handle 404s before WordPress.

Clear your caching plugin and CDN, then test in a private window with a fresh made-up URL.

On classic themes, confirm 404.php sits in the child theme's main folder, not a subfolder, and that the child theme is active.

Some hosts and server configs show their own error page for missing files such as images. That is normal; WordPress only handles 404s for addresses that reach it.

If a plugin and your theme both try to control the 404 page, deactivate one and test again.

Frequently asked questions

Where is the 404 page in WordPress?

On block themes, it is the Page: 404 template under Appearance, Editor, Templates. On classic themes, it is the 404.php file in the theme folder. It is not listed under Pages unless a plugin created one.

Can I make a 404 page without coding?

Yes. Block theme users can edit the 404 template visually in the Site Editor. Classic theme users can build a normal page and use a 404 page plugin to show it whenever a link is broken.

Should I redirect 404 errors to the home page?

No. Sending every missing URL to the home page confuses visitors and search engines treat it as a soft 404. Redirect only moved pages to their closest match, and let truly missing pages show a helpful 404 page.

Does a custom 404 page help SEO?

Indirectly. It keeps visitors on your site and helps them find content, but search engines only need the correct 404 status. Fixing broken links and redirecting moved pages matters more for SEO than the page design.

How do I test my WordPress 404 page?

Visit a made-up address on your site, such as your domain followed by a random word. Check that the custom page appears and, in your browser's developer tools, that the response status is 404.

Sources

  1. Personalizing your 404 Template Learn WordPress
  2. Template Hierarchy WordPress Developer Resources
  3. 404page – your smart custom 404 error page WordPress.org Plugins
  4. HTTP status codes, network and DNS errors Google Search Central
  5. 404 Not Found MDN Web Docs

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.