How To Create A Custom 404 Error Page In WordPress


Warning: Division by zero in /var/www/sites/jtnew/wp-content/themes/twentysixteen/functions.php on line 2

Warning: Division by zero in /var/www/sites/jtnew/wp-content/themes/twentysixteen/functions.php on line 2

Warning: Division by zero in /var/www/sites/jtnew/wp-content/themes/twentysixteen/functions.php on line 2

Warning: Division by zero in /var/www/sites/jtnew/wp-content/themes/twentysixteen/functions.php on line 2

Warning: Division by zero in /var/www/sites/jtnew/wp-content/themes/twentysixteen/functions.php on line 2

Warning: Division by zero in /var/www/sites/jtnew/wp-content/themes/twentysixteen/functions.php on line 2

Warning: Division by zero in /var/www/sites/jtnew/wp-content/themes/twentysixteen/functions.php on line 2

Warning: Division by zero in /var/www/sites/jtnew/wp-content/themes/twentysixteen/functions.php on line 2

Warning: Division by zero in /var/www/sites/jtnew/wp-content/themes/twentysixteen/functions.php on line 2

If everything went well, you found this post by way of this site’s home page or a link or maybe you just typed it in. The important thing is that you found it, but what would happen if the link was wrong or the post vanished. On most sites, when a page is not found, the server generates a “404” error code to let the browser know. Chances are good that you’ve seen the result of this a few times. Usually, it’s boring and sometimes even uninformative, leaving you with nowhere to go. If you have a blog or website, surely you’d like to keep that visitor interested and help them find other content on your site. You’re in luck because today, I’m going to tell you how.

Create Custom Error Pages

Custom 404 - JoeTech.com

What you see above is my custom 404 error page. In WordPress, I replaced everything in /wp-content/themes/joetech/404.php with my own HTML to make my error page custom. The HTML can be anything you want, but you should make sure to view it in a browser by trying to visit any non-existing page on your blog. In my case, I went old school with the famous Windows Blue Screen of Death that often felt like an extension of Windows 98, popping up more often than anyone would like. Of course, I changed it around a bit to include a Star Wars quote and links both to my site and to share the 404 page on Facebook for any who think it’s amusing.

While 404 is the error code and page that surfaces the most, web servers have several codes to indicate the result of a web request. A couple others that come in just behind 404 are 403 (Forbidden) and 500 (Internal Server Error). Many years ago, at an Internet service provider I worked for, we had Macho Man Randy Savage for our 500 page and Mr T. was there to “Pity da Foo” who tried to access a forbidden page. Have fun with it and post links to your results in the comments below.

Author: Joe Colburn

Joe Colburn is a software engineer specializing in PHP and a technology enthusiast. Always eager to dive into new and exciting things, Joe writes about anything technology related news and products that he thinks you will also be excited about. Find Joe Colburn on Google+ or by any of the links below.

3 thoughts on “How To Create A Custom 404 Error Page In WordPress”

  1. Hi Joe! I’m really impressed with your idea regarding the 404 error page in WordPress! ahaha a blue screen of death will definitely scare your visitors!
    Anyway nice share of ideas!

    Vinson from Techie-Pinoy.com

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.