Blog · WebJi® India

Custom 404 Page in WordPress

Quick answer: A custom 404 page in WordPress is the template WordPress shows when a visitor requests a URL that is not on the site. On a block theme, edit the 404 template under Appearance, then Editor, then Templates. On a classic theme, use a 404 plugin or edit 404.php in a child theme.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Young Indian woman in a kurti registering a domain name on her laptop at a wooden desk with a sketch notebook — custom 404 page wordpress

What a custom 404 page in WordPress shows

WordPress serves this template when the query finds no post, page, or file at that address. The home page can be fine while one old path returns the 404 template. That is one missing URL, not a site that is down.

If every inner page returns 404 and wp-admin still opens, the rewrite rules are the fault. Designing the template will not fix that. Follow the WordPress 404 error fix first.

  • The response should be HTTP 404, not a normal page with a sad headline.
  • The theme file is 404.php, or the Site Editor template named 404.
  • If the theme has neither, WordPress falls back to index.php and the visitor may see the blog loop.
  • A custom web page you publish under Pages does nothing until a plugin or the template points at it.
MethodWhere you editUse it when
Site Editor templateAppearance, then Editor, then Templates, then 404The theme shows Editor
A page plus one pluginPages, then the plugin screenA classic theme, and you do not want PHP
404.php in a child themeThe child theme folderYou want the markup and the 404 status in your own file

What to put on a custom WordPress 404 page

Say the address is not on the site, in one sentence. Keep the same header and footer so the visitor still knows which site they are on.

  • A search field, from the Search block or the theme search form.
  • A link to the home page and two or three real sections, not every post on the site.
  • The same header and footer. Do not hide the menu on a blank screen.
  • No form that pretends the missing page can be ordered. One email link is enough.

A page that looks like a normal article and returns HTTP 200 is a soft 404. Search engines can keep that URL as a thin page.

Young Indian woman in a kurti registering a domain name on her laptop at a wooden desk with a sketch notebook — custom 404 page wordpress

Edit the WordPress 404 template in the Site Editor

Use the Site Editor when Appearance shows Editor. That is a block theme. A classic theme stops at Customize and has no Templates list.

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

You know it worked when your message appears on that URL. Elementor free does not replace this template. The 404 display condition is in Elementor Pro Theme Builder. Without that licence, use the plugin method or 404.php.

Set a custom 404 page with a WordPress plugin

Build the layout as an ordinary page, then tell one plugin to show that page when nothing matches. This fits a classic theme when you do not want to edit PHP.

  1. Open Pages, then Add New. Write the message, add search, and link real pages. Publish.
  2. Install one plugin that lets you choose a page as the 404. Do not install a second one.
  3. In that plugin’s screen, select the page you published and save.
  4. Request /not-on-this-site/ in a private window.

You know it worked when your page appears and the status is 404. If the status is 200, the plugin served a normal page. That is a custom page not found in name only, and it can be read as a soft 404. Use a plugin that keeps status 404, or edit 404.php instead.

Edit 404.php for a custom WordPress 404 page

Put the file in a child theme. An edit in the parent theme disappears on the next theme update. Do the work on a staging copy, or after a backup you can restore.

  1. Copy the parent theme’s 404.php into the child theme. 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 child file. Do not paste it into the parent from Appearance, then Theme File Editor.
  4. Reload a fake URL. Add one temporary word, confirm it shows, then delete that word.

WordPress hosting with a staging copy makes this safer than editing the live theme. Free migration onto that account is subject to terms and approval, and the work is quoted by email before payment.

Test the custom 404 page and repair the missing URLs

The template only greets people who already missed. It does not put the old URL back.

  • Open one fake path and one real page. Only the fake path should use the template.
  • Read the status in the browser network panel. You want 404.
  • In Search Console, open Page indexing and read Not found (404). Restore a page that should exist, or redirect one that moved.
  • If the whole site 404s, stop designing and fix permalinks first.

When a WordPress custom 404 should be a 301

A 301 is for a URL that moved to one new page. A 404 is for a URL that has no replacement. Sending every miss to the home page looks helpful and reads as a soft 404.

Add a 301 when one old slug has a clear new page. Leave true misses on the custom 404 page. The steps are in WordPress 301 redirects.

Frequently Asked Questions

How do I customize the 404 error page in WordPress?

On a block theme, open Appearance, then Editor, then Templates, then 404, and save. On a classic theme, assign a published page with a 404 plugin, or edit 404.php in a child theme.

How do I see my custom 404 page?

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

Why are my WordPress pages showing a 404 error?

One URL means that page is missing or the slug changed. Every inner page means the rewrite rules were not saved. Resave Settings, then Permalinks, before you redesign the template.

Does a custom 404 page hurt SEO?

A real HTTP 404 does not hurt the pages that exist. A soft 404 does: a not-found message that returns 200, or a redirect of 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 if it moved. Leave it on the custom 404 page if there is no replacement.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →