Create a 404 Page in WordPress

Brilliant Ways to Create a 404 Page in WordPress and Why

What You'll Learn

A 404 page is where a website sends you when you ask for a page that doesn’t exist. Normally, this is a generic page with a simple error on it. However, you can Create a 404 Page in WordPress so that someone who lands on it is more likely to stick around and look at your other content.

Done right, with a little creativity, you can even use your 404 page to improve your SEO.  This can be a real benefit because the 404 page is telling your user that you don’t have what they wanted.

It’s a bit like walking into a store that you thought you had the product you wanted. Normally, you would turn around and walk out again but instead, you see something interesting and stick around.

Why a 404 Page Happens

A 404 page can happen for a few reasons. Coming from a search engine, this is telling you that you used to have content there and it doesn’t work anymore.

A few common reasons for 404 pages include

  • You deleted a page
  • You changed a URL
  • A redirect isn’t working
  • Someone built a bad link to your page (maybe you)

While you’re not likely to avoid 404 pages completely,  if you find out that you have a bad link in a search engine results page, claim it!  Take advantage of search engine results that you already have. Build some valuable, relevant content and add it a page at the URL.

Avoiding 404 Page Hits

Ideally, readers would always find what they’re looking for on your site. Unfortunately, that’s not a reality. Sometimes, we can do things to improve their experience and have them land on actual content. The easy way to avoid someone landing on your 404 page is to keep track of bad links and fix them.

Broken Link Checker

Broken Link Checker

One very easy task is to make sure that all of the links on your site work. Thankfully, there is a free plugin, Broken Link Checker, that will do this for us. It will scan your site and all its links. It will report on any broken links and can email you when it finds a broken link. From the interface on the admin dashboard, you can edit links without having to edit each page or post with links.

Monitoring 404 Hits to Your Page

Rank Math 404 Monitor Admin Dashboard Menu

RankMath, one of the premiere WordPress SEO plugins has a great 404 monitor for this. It will tell you the 404 hits to your site. Using this, you can see what URL someone is using to reach your site, but they land on your 404 page. From here, you can do a few things:

  • Build New Content – If you find that a lot of people are coming to the same URL, maybe another site has a bad link. You’re not that likely to easily get another site to change a link and you might lose the link. So instead, maybe you should look at the link and create a new page or post with that URL. Then you get a new link and more traffic!
  • Redirect the URL – Maybe it’s a typo and you already have similar content. RankMath allows you to build a redirect directly from the interface. This is an easy way to capture the traffic using content that you already have.
404 Monitor Hover Menu
Rank Math 404 Monitor Hits Column

Why 404 Pages are a Problem

We have all had it happen. We click on that link that sounds like it will finally give us the answer we’ve been searching for. The Holy Grail is around the corner. We click that beautiful link and…404 error. Noooo!!!!

Our next step?  Hit the back button and try the next one. This is called pogo sticking. It hurts your site in a few ways.

  • Your user leaves, frustrated. They didn’t get their answer and you didn’t get the opportunity to serve them. No sales, ad displays, no interactions.
  • The user did what is called “pogo-sticking” when they bounce onto the site and back off again. This hurts your bounce rate and time-on-page metrics.
  • It’s likely to happen again because you have a broken link out there somewhere.
RELATED:   WordPress Roles and Capabilities - Launch the Power of Your Site

via GIPHY

This is no good at all. When you Create a 404 Page you are trying to avoid these issues and maybe even keep a user around who wouldn’t have stayed.

Specific Strategies to Create a 404 Page 404 Page

No matter what you do, you are likely to have some 404 errors.  You can make the best of a bad situation. Create your 404 Page and try to keep users on your site by offering value.

For every site, this is a little bit different. Some ideas include:

Treat it Like a Landing Page

Like any page that a user comes to for a solution. A solid landing page will help to keep them around. Your page should be branded and brand consistent.

The first is easy but for the second, your 404 page should match the look, feel, and tone of the rest of your site. If your site is fun and irreverent, then your 404 page should be too. A serious site should have a serious (but helpful) 404 page.

Include Links

You want to add links to your most popular pages, tools, or products. If in doubt, more links are better. There’s no charge and you don’t know how your user got there so consider how you can entice them to stick around.

Also consider adding a lead magnet that’s consistent with the rest of your site or a link to it. Maybe you’ll get another email subscriber from it.

Add a Search Bar

Your user was interested enough to click on the broken link. They could be interested enough to keep looking on your site for the answer to their question.

Adding a search bar will give them a chance to do that (you may already have one in your header but it might be worth pointing it out.)

Tell Them How They Got There

It can be really frustrating landing on a 404 page. Not everyone knows why they happen. Explaining that to your user could help to ease some of that frustration and get them to stick around.

If nothing else, maybe they’ll stick around long enough that Google doesn’t ding you with a bounce.

Don’t Pick Just One

The good news is that you don’t need to decide on just one of these strategies. In fact, you can apply them all.

Any combination of these or other ideas can keep readers a bit longer and maybe have them experience more of your site.

At the end of the day, done right, when you Create a 404 Page, you can provide more value to users. You can also turn a bad link into an SEO opportunity.

Checking your 404 page

The first thing you need to do is take a look at what you have now for a 404 page. There’s a good chance your theme has a generic 404 page that is what users see. Here’s how to do that.

  • Simply type “yourURL.com/404” in the address bar of your web browser. That’s it. You will see your 404 page. Normally, it will be a boring page that doesn’t say much.
Generic WordPress 404 Page

Here’s your chance to make it more interesting, like this one from Marvel. If you’re using a page builder like Elementor, you can use that to build your 404 page.

Marvel 404 Page

Setting Your Own 404 Page Using a WordPress Plugin

To keep things simple, we are going to show you how to use a plugin to create a custom 404 page. You could avoid the plugin and do it with code (or have a developer do it for you).  It’s not complicated but would require a bit of coding expertise. We can refer you to someone if you need to go that route for some reason.

RELATED:   How to Get Started on Upwork

Installing 404Page

We’re going to install 404Page, which is an easy custom plugin. To do that, go to your admin dashboard.

  • Go to Plugins in the menu on the left.
Plugins Admin Dashboard WordPress
  • Select Add New
Plugins Menu Admin Dashboard Add New
  • In the upper righthand corner is a search bar. Type in “404Page”.
C:\Users\Dave\Downloads\WordPress Admin Dashboard Plugins Add New Search.png
  • In the results, select the one that says “404page – your smart custom 404 error page” and press Install Now. When it’s done installing, select Activate.

Now that your plugin is installed, we need to do a few things to get our site ready. You might have already done this, but please make sure.

Preparing your website, before using the plugin

We need to adjust a few things on the site to make all this work correctly.

Setting the Permalinks To Create a 404 Page in WordPress

You will need to activate permalinks for this to work correctly. We go into a lot of detail on the right permalink strategy for SEO but for our 404-page strategy, make sure that you don’t have “plain” selected. Here’s how you can do that.

  • On the left menu of your Admin Dashboard, select Settings and then Permalinks.
Administrator Menu Permalinks
  • On the next page, make sure that “Plain” is not selected. In general, Post Name is a good choice.
WordPress Admin Permalinks Menu with Post Name
  • Press Save Changes at the bottom of the screen.
Save Changes Button

Creating a 404 Page

Now you have to make a page to be your 404 page. We have some recommendations on things to include below and how an optimized 404 page can help you with your search engine optimization. For now, we’re going to create a page to use and you can customize it more later.

  • Select Pages
  • Select Add New
WordPress Admin Pages Add New Highlighted
  • Create your 404 page. You can include anything that you can include in any other page. Don’t worry, you can edit it more later if you want.
  • Press Publish
WordPress Publish Button

Set Your Custom 404 Page

Now that we have our Permalinks set and our 404 page is created, it’s time to make that page our actual 404 page. So, we go back to our plugin.

  • Go to Plugins on menu on the left.
Plugins Admin Dashboard WordPress
  • Select Installed Plugins
WordPress Admin Menu Installed Plugins
  • You’ll see a list of all your installed plugins. Find 404page and select settings. This will take you to the settings page for the 404page plugin.
404Page Plugins Menu Settings
  • At the top of the options, select your page from the dropdown in the section labeled Page to Be Displayed as 404 Page.
  • If you want to keep your 404 Page out of the Pages list to avoid it being accidentally deleted or changed you can do that by checking the Hide from Pages box. If you do this, remember that you will need to come into this section to edit your 404 page.
404page HIde Page from Pages List
  • At the bottom of the screen, press Save Changes (don’t forget this.)
Save Changes

There you go, now you have a custom 404 page. Sometimes, you don’t want to use a plug-in though. Of course, that can be done too!

Setting a Custom 404 Page Without a Plugin

Of course, if you can do it with a plugin, you can do it without one too. This is a bit more technical and may require a developer depending on how comfortable you are with making these kinds of changes. You will need to directly edit the file that makes up the 404 page and will require some knowledge of HTML and PHP which are what make up your website.

Before doing these kinds of changes, it’s a good idea to use a child theme so that your hard work isn’t written over the next time that your theme is updated.

Caution: If you do this wrong, you could create an error that stops your site from working correctly, so be careful.

  • On the left hand menu, select Appearance.
WordPress Admin Menu Appearance
  • In that menu, select Theme Editor. This is where you can edit the files directly that make up your theme.
WordPress Admin Menu with Theme Editor Highlighted
  • You’ll probably see a warning about editing the files. Click OK after reading it. On the right hand side will be a list of files. You should see one that says something like functions.php or theme functions. This let’s you add code to your site to add functionality.
Theme Functions
  • Paste the following code into your file except in the part that says “your-slug” paste the URL of your custom 404 page that we made above.

add_action ('template_redirect' , 'custom_404', 10);
function custom_404()
{
	if( is_404())
       {
        wp_redirect( get_site_url().'/{your-slug}');
        exit;
       }
}

List 25 404 Page

Ways to Create a 404 Page in WordPress to Improve SEO

Your 404 page has the added benefit of potentially improving your SEO.  Of course, you’d like to avoid bad links, but like we discussed above, sometimes you have no control over it and mistakes will always happen. 

RELATED:   Is My Website Mobile-Friendly - How to Find Out

First, think of your 404 page as an opportunity.  If someone gets to your 404 page, then something was broken. They found a link that doesn’t work anymore.  This gives you two opportunities

  1. They were looking for something on your site and were interested enough to click on it.
  2. Even though something wasn’t working right, you didn’t lose them.  You can now use your 404 page to show what you can do for them and potentially keep them on your site.

To take advantage of these opportunities, you want more than a boring 404 page that tells them there’s an error.  You need to show them who you are and that your site can help them.

A few things that you should consider doing to get more from your 404 page.

  • Brand Your 404 Page – Make your 404 page match your brand, add your menus and the other things that define your site. This gives them a chance to look around your site and you start to build a relationship with them.
  • Explain What Went Wrong – Landing on a 404 page when you thought that you had that magic solution can be really frustrating.  It can help to understand what went wrong and how they got there. Then you can offer them some solutions.
  • Add Your Most Popular Articles – There’s a good chance that they got there because they are interested in the same stuff that others are interested in.  Show them your most popular articles and pages.
  • Add a Search Bar – Give them a chance to search for things that might interest them.
  • Track Your 404 Hits – Plugins like RankMath allow you to track when a user lands on your 404 page and URL they were looking for.  If there are links that are sending multiple readers to your 404 page, consider building an article (or redirect that URL to something similar.)  You have ready-made backlinks and apparently, there is interest.  It’s like having a free keyword search.

You can’t avoid 404 errors on your site, no matter how careful and diligent you are.  Use your 404 page to your audience.  We’ve gone over to how set up your own custom 404 page easily and then what you can put on there when you’ve done it. 

Creating Your WordPress 404 Page – How and Why

In this article we discussed why you should optimize your 404 page. We talked about how it can improve your SEO and how it can benefit your readers. We also talked about how to cut down on readers getting 404 pages.

From there, we talked about how you can customize your 404 page. We gave you an easy, free plugin that you can use to customize your 404 page. Then, we gave you some ideas of things you can do to improve your 404 page.

Good luck and thank you for your time!

Leave a Comment

Your email address will not be published. Required fields are marked *

Share via
Copy link
Powered by Social Snap