How to Create a Custom 404 Page in WordPress

14 December 2025

Sean Horton

In Brief

A custom 404 page keeps visitors on your site when they hit a broken link or mistyped URL

Good 404 pages include a clear message, search bar, navigation links, and a link to your homepage

The easiest method is using a free plugin like Smart Custom 404 Error Page

Block theme users can edit the 404 template directly in the Site Editor

GeneratePress Premium users can create a 404 page using the Elements feature

Always test your 404 page by visiting a fake URL on your site

A potential customer finds your business through Google, clicks the link, and lands on a page that simply says “Oops! That page can’t be found.”

No menu. No search box. No way forward.

What do they do?

They leave. And they probably won’t try again.

This scenario plays out on thousands of WordPress sites every day. Broken links happen to everyone. Someone bookmarks a page you later remove. They mistype a URL. An old blog post links to content that no longer exists.

When visitors hit these dead ends, your 404 page determines whether they stay or go.

The good news is that creating a helpful custom 404 page takes less than fifteen minutes.

You’ll learn three different methods here, starting with the simplest plugin approach and moving through to editing theme files directly. Pick the method that matches your confidence level.

What is a 404 Page and Why Does It Matter?

A 404 error occurs when someone tries to visit a page that doesn’t exist on your website.

The “404” is an HTTP status code telling the browser that the server couldn’t find the requested page. Every WordPress site has a 404 page, even if you’ve never looked at yours.

Most default WordPress 404 pages are basic, and unhelpful.

They typically show a heading like “Nothing Found” or “Page Not Found” with perhaps a sentence or two of text. Some themes add a search box, but many don’t. This bare-bones approach does nothing to help visitors find what they were looking for.

Your 404 page matters for two reasons.

First, it affects whether visitors stay or leave. A helpful 404 page with clear navigation options gives people a reason to explore further. A blank error message gives them every reason to hit the back button.

Second, 404 errors can affect your search engine rankings indirectly.

Google won’t penalise you for having some 404 errors, as these occur naturally on every website. But if visitors consistently leave after hitting 404 pages, your bounce rate increases. High bounce rates signal to search engines that your site isn’t meeting visitor expectations.

How to Fix WordPress 404 Errors

What Makes a Good 404 Page?

You can fully customise a 404 page for your site, just like every other page.

Elements Every 404 Page Needs

A helpful 404 page should include several key elements.

Start with a clear, friendly error message. “Sorry, we couldn’t find that page” works far better than “Error 404: Resource Not Located”.

Let visitors know they haven’t done anything wrong and that the page simply doesn’t exist.

Add a search bar so visitors can look for the content they wanted. Include links to your most popular pages or main service categories. A prominent link to your homepage gives people an easy way out. If you run a service business, consider adding your phone number or email so visitors can reach you directly.

Ideally your 404 page should match your website’s design.

Using your standard header, footer, and colour scheme helps visitors feel they’re still on your site rather than stuck in some technical dead end. Consistency builds trust, even on error pages.

What to Avoid

Never automatically redirect all 404 errors to your homepage.

This confuses visitors because they clicked a specific link and expected specific content. Landing on the homepage without explanation feels broken. Google also treats mass homepage redirects as poor practice and may view them as soft 404 errors.

Avoid technical jargon that might confuse non-technical visitors. Don’t leave the page completely blank or use only the default WordPress message.

And test your 404 page before assuming it works correctly.

Method 1: Using a Plugin (Easiest)

If you want a custom 404 page without touching any code, a plugin is your best option. This method works with any WordPress theme and takes about ten minutes to set up.

Step-by-Step Instructions

The Smart Custom 404 Error Page plugin is free and has over 300,000 active installations. Here’s how to use it:

  • Go to Plugins, then Add New in your WordPress dashboard
  • Search for “Smart Custom 404 Error Page”
  • Click Install Now, then Activate
  • Go to Pages, then Add New
  • Create your custom 404 page using the standard WordPress editor
  • Add your error message, search bar, navigation links, and anything else you want
  • Publish the page
  • Go to Appearance, then 404 Error Page
  • Select the page you just created from the dropdown menu
  • Click Save Changes

The plugin handles all the technical setup. Your custom page will now appear whenever someone hits a 404 error. You can update it anytime by editing the page normally.

This method works best if you want full control over your 404 page design using the WordPress block editor or a page builder like Elementor.

What Are WordPress Plugins?

Method 2: Using the Site Editor (Block Themes)

If your WordPress site uses a block theme like Twenty Twenty-Four or Flavor, you can edit the 404 template directly in the Site Editor.

This method doesn’t require any plugins or code.

Step-by-Step Instructions

First, check whether your theme supports the Site Editor. Go to Appearance in your dashboard. If you see “Editor” rather than “Customise”, your theme supports Full Site Editing.

  • Go to Appearance, then Editor
  • Click on Templates in the left sidebar
  • Look for the 404 template and click on it
  • If no 404 template exists, click “Add New Template” and select 404 from the options
  • Use the block editor to build your custom 404 page
  • Add a heading block, paragraph blocks for your message, a search block, and navigation links
  • Click Save when finished

The Site Editor approach keeps your 404 page consistent with your theme’s design automatically. Any changes you make to your global styles will also apply to your 404 page.

This method works best if you’re already comfortable with the WordPress block editor and using a modern block theme.

What Are WordPress Page Builders?

Method 3: Using GeneratePress Elements

GeneratePress is one of the most popular WordPress themes for small business websites. If you’re using GeneratePress Premium, you can create a custom 404 page using the Elements feature without any coding.

What You Need

This method requires GeneratePress Premium, which includes the Elements module. The free version of GeneratePress doesn’t have this feature, so you would need to use Method 1 (plugin) or Method 4 (theme file editing) instead.

Step-by-Step Instructions

The Elements feature lets you create custom content templates for specific parts of your site, including the 404 page. Here’s how to set it up:

  • Go to Appearance, then Elements in your WordPress dashboard
  • Click Add New Element
  • Select Block Element as the element type
  • Choose Content Template from the Element Type dropdown
  • Give your element a name like “Custom 404 Page”
  • In the editor, build your 404 page content using blocks
  • Add a heading with your error message
  • Add a Search block so visitors can find content
  • Add paragraph blocks with links to your main pages
  • In the Display Rules section on the right, click Location
  • Select 404 Template from the dropdown
  • Click Publish

Your custom content will now replace the default GeneratePress 404 page content. The page will still use your theme’s header and footer, keeping everything consistent with the rest of your site.

Optional: Hide the Default Title

GeneratePress adds a default “Oops! That page can’t be found” title to 404 pages. If you want to use your own title instead, you can hide the default one. Add this code to your site using a plugin like Code Snippets:

add_filter( 'generate_404_title', '__return_empty_string' );

This removes the default title so only your custom content appears.

Why This Method Works Well

Using GeneratePress Elements keeps your 404 page within the theme’s system. You get the same editing experience as the rest of your site, and the 404 page automatically inherits your theme’s typography, colours, and spacing.

Updates to GeneratePress won’t affect your custom 404 content because Elements are stored separately from theme files.

Method 4: Editing Your Theme File (Advanced)

For more control over your 404 page, you can edit the theme file directly. This method requires some comfort with code and file editing.

First take a backup.

Important: Use a Child Theme

Before editing any theme files, create a child theme first. If you edit files in your main theme and then update that theme, your changes will be lost. A child theme protects your customisations from being overwritten.

If you haven’t created a child theme before, your hosting provider may offer a tool for this. Alternatively, plugins like Child Theme Configurator can create one for you in a few clicks.

Editing the 404.php File

Most WordPress themes include a 404.php file in the theme folder.

You can find this in your WordPress dashboard under Appearance, then Theme File Editor. Look for 404.php in the list of theme files on the right side of the screen.

If your theme doesn’t have a 404.php file, WordPress uses the index.php template instead. You can create a new 404.php file in your child theme to override this behaviour.

The 404.php file contains the HTML and PHP code for your error page. You can edit the text, add new elements, or restructure the layout. Basic HTML knowledge helps here, but you can make simple text changes even without coding experience. Look for text between quotation marks or within paragraph tags to find content you can safely edit.

After saving your changes, test the page immediately by visiting a URL that doesn’t exist on your site. If something breaks, you can restore the original file or switch to a different method.

WordPress Child Themes: Do You Really Need One?

How to Test Your Custom 404 Page

Type your website address followed by a random string of characters in your browser. For example, if your site is example.co.uk, try visiting example.co.uk/xyz.

Your custom 404 page should appear.

Check that all elements display correctly: your message, search bar, navigation links, and any images. Click the links to confirm they work.

If you’ve made changes but still see the old 404 page, clear your browser cache first.

Caching plugins can also cause issues, so clear your WordPress cache too if you use one. Some managed hosting providers cache pages aggressively, so you may need to purge the cache from your hosting dashboard.

And lastly, always check your site using incognito mode.

Monitoring 404 Errors on Your Site

Once your custom 404 page is live, keep an eye on what’s causing 404 errors. Google Search Console is free and shows you which URLs on your site are returning 404 errors.

Sign into Google Search Console and go to Pages under Indexing. Look for pages listed as “Not Found (404)” to see what URLs are causing problems.

Some of these might be typos from external sites, which you can safely ignore. But if you spot patterns, you might need to set up 301 redirects for moved content or fix broken internal links.

Regular monitoring helps you catch issues before they affect too many visitors. Check your 404 report monthly as part of your site maintenance routine. If you notice the same URLs appearing repeatedly, consider whether that content should be restored or redirected somewhere useful.

If you use Rank Math this will keep a log of 404 errors that you can review from time to time.

Conclusion

Creating a custom 404 page is one of the simpler improvements you can make to your WordPress site.

Whether you choose the plugin method, the Site Editor, GeneratePress Elements, or direct file editing depends on your theme and comfort level. For most small business owners, the plugin approach works perfectly.

The key is having something better than the default WordPress error page.

A helpful 404 page keeps visitors engaged and gives them clear paths back to useful content. Combined with regular monitoring, you’ll provide a better experience for everyone who visits your site.

404 errors are just one type of WordPress issue you might encounter. Keeping on top of errors, whether they’re 404s, plugin conflicts, or database problems, helps your site run smoothly and keeps visitors happy.

If you’d rather focus on running your business than troubleshooting WordPress, professional support can handle the technical setup for you and also includes ongoing WordPress Error Fixes.

Frequently Asked Questions

404 errors happen when someone visits a page URL that doesn’t exist. Common causes include deleted pages, changed URL structures, mistyped addresses, and external sites linking to content you’ve removed. Most 404 errors are harmless and occur naturally on every website.

Having some 404 errors won’t directly harm your rankings. Google treats these as normal. However, many 404 errors can indicate poor site maintenance, and high bounce rates from unhelpful 404 pages may indirectly affect your SEO. Focus on having a helpful 404 page and fixing genuine broken links.

No. Redirecting all 404s to your homepage confuses visitors and is poor practice for SEO. Google’s guidelines specifically advise against this approach. Instead, create a helpful 404 page with navigation options, or set up specific 301 redirects for moved content to relevant replacement pages.

Not necessarily. Using a plugin like Smart Custom 404 Error Page requires no coding at all. If your theme supports Full Site Editing or you use GeneratePress Premium, you can use the block editor without code. Only the direct theme file method needs some HTML knowledge.

Include a clear, friendly error message explaining the page wasn’t found. Add a search bar so visitors can find content. Include links to your most popular pages or main sections. Add a prominent link to your homepage. For service businesses, include contact information. Match your site’s design throughout.

Yes. If you have Elementor Pro, you can create a 404 page template in the Theme Builder. With Elementor free, use the Smart Custom 404 Error Page plugin and build your page using Elementor’s editor. The plugin displays whatever page you create, regardless of how you designed it.

If you have GeneratePress Premium, go to Appearance, then Elements. Create a new Block Element, select Content Template as the type, and build your 404 content in the editor. Set the Display Rules location to “404 Template” and publish. Your custom content will replace the default 404 page.

The free version of GeneratePress doesn’t include the Elements feature needed for easy 404 customisation. You have two options: use the plugin method (Method 1), which works with any theme, or create a child theme and edit the 404.php file directly (Method 4).

Google Search Console shows 404 errors in the Pages report under Indexing. You’ll see which URLs Google attempted to access but couldn’t find. Plugins like Redirection and Rank Math also track 404 errors on your site and show you which URLs visitors tried to access.

About the author

Sean has been building, managing and improving WordPress websites for 20 years. In the beginning this was mostly for his own financial services businesses and some side hustles. Now this knowledge is used to maintain and improve client sites.

Read more articles