How to set up a custom 404 page on WordPress

How to set up a custom 404 page on WordPress

Not all bloggers think to set up a custom 404 page on their blogs. To be honest, if the lovely Aby Moore hadn’t mentioned it in one of her Facebook lives I’d never have thought about it. But it really is a brilliant idea. If someone lands on a page that isn’t there any more, with a custom 404 page set up you still have a chance to get them to stick around.

It’s actually really easy to set up a custom 404 page on WordPress too.

 

What is a 404 page?

If someone clicks on a link to your site to a page that doesn’t exist any more they’ll be redirected to a 404 error page. Usually the page will display a message along the lines Page not Found with a search box for you to search the site for what you’re looking for.

404 is the http error code that means a page couldn’t be found. I’m not going to go into any more detail on http codes here, because even for me they’re boring, and you don’t need to know too much about them as a blogger.

 

Why would you want to set up a custom 404 page?

Let’s be honest, no-one wants their readers to be redirected to an error page. But it will happen from time to time, so¬† try to use it to your advantage.

With a custom page you can put anything you want on it – a link to your mailing list sign-up form, paid products or even your most popular posts. Do you see what I’m getting at now?

If I click a link that sends me to a bog-standard 404 screen, I won’t waste any more time on that site. But, I might be tempted to stick around if the 404 page has something that catches my eye.

 

How to set up a custom 404 page on WordPress

You have two options when it comes to setting up a custom 404 page on wordpress. You can either use a plugin or you can create a new file.

As I use X Theme here at The BLog Genie so I’m going to show you how to set it up using X Theme first, then I’ll show you how to set it up using a free theme (using my new demo subdomain).

 

X Theme – Using a plugin

Setting up a custom 404 page using X theme is really easy.

  1. Pop over to the X theme dashboard and scroll down to extensions.
  2. Scroll through the extensions until you get to the Custom 404 extension, click the Install button.How to Set Up a Custom 404 Page on WordPress
  3. Once it’s installed click the Activate button and you’ll be taken to the Plugins page.
  4. Scroll down to the 404 plugin and click Activate.How to Set Up a Custom 404 Page on WordPress
  5. Hover over the X menu in the left panel of the WordPress dashboard and then click on the Custom 404 option right at the bottom of the menu.
  6. Check the checkbox and choose the page you want to be displayed when a 404 error happens.How to Set Up a Custom 404 Page on WordPress
  7. Navigate to a page on your site that you know doesn’t exist, I used thebloggenie.com/abcSet Up A Custom 404 Page on WordPress

 

Here’s a short video I recorded while setting up my custom 404 page.

 

Other Themes – Using a Plugin

For non X Theme users you can also use a plugin. On my demo site I downloaded the 404Page plugin. I literally just searched 404 and installed the one with the most active users with the highest rating and this was it. I’m stabbing in the dark a bit right now, I installed it as I was writing this post.

 

  1. Go to your add plugins page and search 404. Like I said above, I used 404Page, but I reckon most plugins will work in a similar way.
  2. Hover over the Appearance menu on the left hand side of the screen and click on 404 Error Page. In the dropdown list choose the page that you want to be displayed when a 404 error happens and click save.Set Up a Custom 404 Error Page on WordPress
  3. To test it, navigate to a page on your site that you know isn’t there. I used demo.thebloggenie.com/abc in this exampleSet Up A Custom 404 Page on WordPress

Adding a Custom 404 page on WordPress without a plugin

If you’d rather not use a plugin you can change your theme’s 404.php file instead. I’ll be honest, depending on your theme it’s probably going to be quicker and easier for you to use a plugin. You’re more likely to be able to make a professional looking page that fits in with the rest of your site doing it your usual way.

*** Before I go any further, I want to stress that you should only choose this method if you’re using a child theme (if you’re not you should be, but that’s a lesson for another day). Also make sure that you take a backup of your site before you start making changes to any files manually. Here’s a tutorial on how to create a WordPress child theme. ***

 

Changing your theme’s 404.php file is really easy if you know a bit of HTML.

  1. Hover over the appearance menu and click on Editor.
  2. Choose your active theme from the dropdown list on the top right, then scroll through the list of files to find the 404.php file. It should look something a bit like this, depending on your theme.
  3. Start making changes. I’m going to make some basic changes just to show you how, what you do with it then is limited only by your imagination and HTML/CSS skills.
  4. To test it, navigate to a page on your site that you know isn’t there. I used demo.thebloggenie.com/abc in this example

How to Set Up a Custom 4o4 Page on WordPress

So there you have it, that’s all there is to setting up a custom 404 page on your WordPress blog. It’s a really simple thing to do but could make a big difference in helping keep people on your blog. The great thing about it is that you can change it up to match your current blog focus. For example if you’re pushing your email list put an opt-in form on your 404 page. Looking to get more people into your facebook group? Put a link and some quotes from current members on your 404 page.

No-one ever wants their readers to get a 404 error, but at least this way, you can use it to your advantage when it does happen.

 

 

You may also enjoy:

How to optimise images for blog posts

How to take a WordPress backup

What is an XML Sitemap and does your blog need one?

Cuddle Fairy

Leave a Reply

Your email address will not be published.