• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Nile Flores Media

Helping You Rock Out Your Website Like A Rockstar

  • Home
  • About
  • Blog
  • Portfolio
  • Hire Me
  • Resources
  • Contact
  • Blogging
  • WordPress
  • Social Media
  • SEO
  • Web Design
  • News
  • Podcast
You are here: Home » Blogging » Do Not Forget Your 404 Page!

Do Not Forget Your 404 Page!

By Nile Flores 5 Comments


A 404 error page, or for those not familiar with the term, the ‘Page not Found error’ is important to have with any website. At Blondish.net, there is an article that illustrates the importance of a custom 404 page in detail, but it is really simple.

1. You are keeping your visitor within the site and giving them an alternate way to find what they are looking for.
2. The search engines will not frown as much on your custom 404 page as you are being courteous to your user, and once again, giving them another way to find what they want on your site.

A lot of themes come with the 404.php file, but there are some that do not. In the case you are making your own theme, or if you have downloaded a freebie, then you can make your own.

1. You need to know where to get the code for the 404 page, which can easily be found in the WordPress Codex. In the case of this tutorial, it will be using the basic code.


<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<h2 class="center">Error 404 - Not Found</h2>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

2. Sure, you have a 404 page that will say “Error 404 – Not Found”, but you really need your site to do something. Perhaps you should add articles that are popular or want your readers to see that may be missed. Or perhaps it was a click on an old internal link from an old blog entry, you should think about putting a search form. A search form will really help.


<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?>

3. Edit your message to something friendly. Sometimes “Error 404 – Not Found” might be a bit shocking and make your user think they did something wrong. You could direct them to the home page of the site or as already suggested, articles you want your visitors to read.

Here is an example that is used here at Blondish.net

Oopsie! Sorry for the inconvenience.

If you were looking for something on Blondish.net, and did not find it you can contact me or use the form below to search for it. Again, apologies!

The message is allowed to be used. Just change the site name. No credit back is needed.

4. Add your recent posts. This may entice your readers to stay on the site. It is also fresh content and easier than adding featured posts (and editing them from time to time.)


<h2>Recent Posts</h2>
<ul>
<?php query_posts('posts_per_page=5');
if (have_posts()) : while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>" title="Permalink for : <?php the_title(); ?>"<?php the_title(); ?></a>
<?php endwhile; endif; ?>
</ul>

5. Get the search engines to find the custom 404 page. In your .htaccess file, you need to put the code:

ErrorDocument 404 /index.php?error=404

In the case your installation is not on the root of your site, but instead a subfolder, you need to make sure the folder name is added before the index.php link for the .htaccess Error Document function.

Very easy, right?


Filed Under: Blogging Tagged With: wordpress

About Nile Flores

Nile is a 43-year old female from the greater St. Louis (Southern Illinois side) area. Nile is a mother of 1 son. She is also a web designer and developer, a graphic designer, and a public speaker, who exclusively designs and develops using WordPress. She also blogs at GoDaddy's Blog, Verpex Hosting's blog and her very personal sites, Pixelled and Nail Polish Happy.




Related posts:

No related posts.

Reader Interactions

Comments

  1. adi kurniawan says

    May 7, 2013 at 10:31 pm

    yeah
    i hate when i found 404 page
    but i like the custom one
    like
    ops seems like you are lost
    click here to go to homepage

    Reply

Trackbacks

  1. Nile Flores says:
    June 20, 2009 at 5:33 pm

    Blondish.net – New blog post: Do Not Forget Your 404 Page! http://bit.ly/11abFN

    [Original tweet, Topsy page]

    Reply
  2. Charity L Gamble says:
    June 20, 2009 at 6:01 pm

    RT @tweetmeme Do Not Forget Your 404 Page! | blondish.net http://tinyurl.com/mx9llh

    [Original tweet, Topsy page]

    Reply
  3. Posts about themes as of June 20, 2009 | All About WordPress says:
    June 20, 2009 at 8:00 pm

    […] to Rio de Janeiro BigCi&#116&#121&#76ife – Free good looking day to day bloging theme&#10&#10&#10Do Not Forget Your 404 Page! – blondish.net 06/20/2009 A 404 err&#111&#114&#32page, or for those not familiar […]

    Reply
  4. Nile Flores says:
    June 24, 2009 at 6:39 pm

    RT @tweetmeme Do Not Forget Your 404 Page! | blondish.net http://tinyurl.com/mx9llh

    [Original tweet, Topsy page]

    Reply

Leave a Reply Cancel reply

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

Primary Sidebar

Follow Me On:

  • Facebook
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube

Get The Latest WordPress & Blogging Tips

Sign up for my newsletter, and also get my free ebook on 10 Reasons Why Your Website Isn't Converting, and How to Fix it!




Try to be More Positive on Social Media

Note: You can click on image and view the video in a larger lightbox window.

Footer

The Blog

Lots of free information, tutorials, and more to help you bring your best foot forward with your website.

  • Blogging
  • WordPress
  • Social Media
  • SEO
  • Web Design

Get The Latest WordPress & Blogging Tips

Sign up for my newsletter, and also get my free ebook on 10 Reasons Why Your Website Isn't Converting, and How to Fix it!

Copyright © 2025 · · WordPress