21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

Custom 404 Page in WordPress

Quick answer

A custom 404 page in WordPress is the template shown when a visitor hits a URL that does not exist. On a block theme, edit the 404 template under Appearance, Editor, then Templates. On a classic theme, assign a published page with a 404 plugin, or edit 404.php in a child theme. Keep the HTTP 404 status.

For WordPress site owners in India who want missing URLs to keep visitors and search signals instead of leaking both.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
4 min
Sections
7
Updated
14 Nov 2026
Written by
WebJi® team

What is a custom 404 page in WordPress?

A custom 404 page in WordPress is the template your site shows when a visitor requests a URL that does not exist — and you can design it yourself. WordPress loads the theme file 404.php, or in a block theme the Site Editor template named 404, whenever a query matches no post, page or file. If the theme has neither, WordPress falls back to index.php and the visitor may see the blog loop instead of an apology.

The home page can load normally while one retired link returns the 404 template — that is one missing URL, not a broken site. But if every inner page 404s while wp-admin still opens, the rewrite rules are the fault and no design will fix it; work through the WordPress 404 error fix first. A normal page you publish under Pages does nothing until a template or a plugin points the miss at it.

Three ways to build a custom 404 page in WordPress
MethodWhere you editUse it when
Site Editor templateAppearance → Editor → Templates → 404Your theme shows Editor (block theme)
A page plus one 404 pluginPages, then the plugin's settingsClassic theme, and you want no PHP
404.php in a child themeThe child theme folderYou want your own markup and status code

What should a WordPress 404 page contain?

A good 404 page says the address is not on this site, offers a search box, and keeps the normal header and footer so the visitor can self-rescue. It does not pretend nothing went wrong by looking exactly like an article.

  • One plain sentence: say the page is not here — no error dump, no blame.
  • A search field: the Search block, or get_search_form() in PHP.
  • Two or three real links: home page plus your main sections, not a list of every post.
  • Same header and footer: the menu keeps the visitor oriented.
  • The HTTP 404 status: a not-found page that returns HTTP 200 is a soft 404, and search engines may keep it as a thin page.

How do you edit the 404 template in the Site Editor?

On a block theme, the 404 page is an ordinary template: open Appearance → Editor → Templates → 404, edit the blocks, and save. A classic theme stops at Customize and has no Templates list — use the plugin or file method below instead.

  1. In wp-admin, open Appearance → Editor.
  2. Open Templates and select 404. If it is missing, choose Add template and pick 404.
  3. Leave the header and footer in place. Replace the default message, add a Search block, and link the home page.
  4. Click Save.
  5. Visit a URL that is not a real page, such as yourdomain.in/not-on-this-site/, in a private window.

You know it worked when your message appears on that URL. Elementor's free version does not replace this template — the 404 display condition lives in Elementor Pro's Theme Builder, so without that licence use the plugin or 404.php route.

How do you set a custom 404 page with a plugin?

Build the layout as an ordinary page, then let one plugin serve that page whenever nothing matches — the practical route on a classic theme. Install a single 404 plugin; running two at once only invites conflicts.

  1. Open Pages → Add New, write the message, add a search block and real links, and publish.
  2. Install one plugin that can assign a page as the site's 404.
  3. In that plugin's screen, select your page and save.
  4. Request /not-on-this-site/ in a private window and read the status in the browser's network panel.

Your page should appear with status 404. If the status is 200, the plugin served a normal page — a custom page-not-found in name only, readable by search engines as a soft 404. Switch to a plugin that keeps the 404 status, or edit 404.php directly.

How do you edit 404.php in a child theme?

Copy 404.php into your child theme and edit it there — an edit in the parent theme is erased by the next theme update. Do the work on a staging copy, or after a backup you can restore. A minimal, correct file looks like this:

<?php
get_header();
?>
<main class="not-found">
  <h1><?php esc_html_e( 'Page not found', 'child-theme' ); ?></h1>
  <p><?php esc_html_e( 'That address is not on this site.', 'child-theme' ); ?></p>
  <?php get_search_form(); ?>
  <a href="<?php echo esc_url( home_url( '/' ) ); ?>">Home</a>
</main>
<?php
get_footer();
  1. Copy the parent theme's 404.php into the child theme folder. If the parent has none, copy index.php, rename it 404.php, and remove the post loop.
  2. Keep get_header() and get_footer(); add get_search_form() and a short list of real links.
  3. Upload the file over FTP or the file manager — do not paste it into the parent from Appearance → Theme File Editor.
  4. Reload a fake URL, confirm your message appears, and check the status is 404.

WordPress hosting with a staging copy makes this safer than editing a live theme. Free migration onto a WebJi® WordPress plan is subject to terms and approval.

How do you test the 404 page and repair the URLs behind it?

The template only greets people who already missed — the repair work is deciding, URL by URL, whether each miss should return, redirect or stay gone. A tested page plus a reviewed URL list is the whole job.

  • Status check: open one fake path and one real page; only the fake path may use the 404 template, and the network panel should report 404.
  • Search Console: under Page indexing → Not found (404), review which URLs Google is meeting.
  • Restore or redirect: bring back a page that should exist; point a moved slug at its new address.
  • Site-wide 404s: if everything 404s, resave permalinks under Settings → Permalinks before touching design — see the permalink structure guide.

When should a WordPress 404 become a 301 redirect?

Use a 301 when the old URL has one clear replacement; keep the custom 404 when the URL has no replacement at all. Redirecting every miss to the home page looks helpful but reads to search engines as a soft 404, because the answer is the same for every question.

The mechanics — plugin, Redirection rules, or .htaccess — are covered in WordPress 301 redirects. A short list of mapped slugs plus an honest 404 for the rest beats a blanket redirect rule.

FAQ

Frequently asked questions

How do I customize the 404 error page in WordPress?

On a block theme, open Appearance → Editor → Templates → 404, edit the blocks and save. On a classic theme, assign a published page with a 404 plugin, or copy 404.php into a child theme and edit it there.

How do I see my custom 404 page?

Open any path that is not a real page, such as yourdomain.in/not-on-this-site/, in a private browser window. The custom template should load, and the browser's network panel should show HTTP status 404.

Why are my WordPress pages showing a 404 error?

One URL returning 404 means that page is missing or its slug changed. Every inner page returning 404 while wp-admin works usually means the rewrite rules were not saved — resave Settings → Permalinks before redesigning any template.

Does a custom 404 page hurt SEO?

A genuine HTTP 404 does not hurt the pages that exist; it is the correct signal for a missing URL. What does cause trouble is a soft 404 — a not-found message served with status 200 — or redirecting every miss to the home page.

What should I do with old URLs that 404?

Restore the page if it should exist. Add a 301 redirect if the content moved to one new address. Leave the URL on the custom 404 page if there is no reasonable replacement — that is the honest answer for both visitors and crawlers.

Last editorial update: 15 November 2026.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.