How to Setup a Custom 404 Error page Design

As a wordpress user you must know that most of the themes comes with their own 404 php page that shows up whenever some one tries visit a invalid URL on your blog. 404 Error totally depends upon how many times you change the url without using a 301 redirect or how many times a user visit a invalid URL.

No matter what’s the reason but whenever a web surfer visit your blog through search engine traffic and greeted with lovely 404 Error, he/she will most likely click the back button and continue browsing other search results. Ultimately increasing your bounce rate but you can retain that traffic by setting up a more user friendly 404 page.

Some Nice 404 page Design

Ateaseweb


Chris Jennings

How to setup a 404 page

  • The steps of setting up a 404 page is fairly easy, Click on your theme editor in WordPress Admin dashboard.
  • Open 404 php file and add this code in your File

<?php get_header(); ?>
<h1>Page Not Found, Error 404</h1>
<p>The page you are looking for no longer exists or moved.</p>
<p>Perhaps you can find what you are looking for by searching the site archives!</p>
<?php get_footer(); ?>

Use this code to add pages

<b>Search by Page:</b>
<ul>
<?php wp_list_pages(‘title_li=’); ?>
</ul>

Use this code to add Archives by Month

<b>Search by Month:</b>
<ul>
<?php wp_get_archives(‘type=monthly’); ?>
</ul>

Use this code to allow user to search in categories

<b>Search by Category:</b>
<ul>
<?php wp_list_cats(‘sort_column=name’); ?>
</ul>

Add this code to show Recent post in your 404 page

<b>Search by Recent Post:</b>
<?php get_archives(‘postbypost’, ’17’, ‘custom’, ‘<li>’, ‘</li>’); ?>

You can also add all the above codes in your PHP file and it will look something like this

<?php get_header(); ?>
<h1>Not Found, Error 404</h1>
<p>The page you are looking for no longer exists.</p>
<p>Perhaps you can find what you are looking for by searching the site archives!</p>
<b>Search by Page:</b>
<ul>
<?php wp_list_pages(‘title_li=’); ?>
</ul>
<b>Search by Month:</b>
<ul>
<?php wp_get_archives(‘type=monthly’); ?>
</ul>
<b>Search by Category:</b>
<ul>
<?php wp_list_cats(‘sort_column=name’); ?>
</ul>
<b>Search by Recent Post:</b>
<?php get_archives(‘postbypost’, ’17’, ‘custom’, ‘<li>’, ‘</li>’); ?>
<?php get_footer(); ?>

You can create a more beautiful and user friendly 404 page with a bit of coding and Photo editing.

Is there anything you want to add this article? Share it with us in our comment section.