May 16

Maximize Your WordPress 404 Error Page

Published in: WordPress — Tags: , , — jai

The 404 or Not Found error message is a standard response code from a web server that says a specific page can not be found.  The server is online and the domain is valid - but the page does not exist.
For example lets day your site is www.mysite.com and you have 3 pages
www.mysite.com/index.php (the home page)
www.mysite.com/about.php
www.mysite.com/contact.php

If somebody types in any of the following they will get the 404 error page

www.mysite.com/about-you.php
www.mysite.com/kontact.php

Or maybe, on one of your pages YOU made the typo and your home page has a link to  www.mysite.com/about-us.php.  Again, the visitor will receive the 404 error message.  404 errors should not be confused with “server not found” or similar errors, in which a connection to the destination server could not be made at all - meaning your site is not working.

404-basicEditing an existing 404 Page

The default WordPress theme has a 404.php file, but not all themes have their own custom 404 error template file. If your theme has a 404 page, it will be named 404.php. WordPress automatically uses that page when a Page Not Found error occurs.

The normal 404.php page shipped with your Theme will work, but does it say what you want it to say, and does it offer the kind of help you want it to offer? If the answer is no, you will want to customize the message in the template file.

A typical 404.php file is easy to read. As you see below, it basically features tags that display the header, sidebar, and footer, and also an area for your message:

404-phpTo edit the page you change the text “Error 404 - Not Found” to whatever you want the page to say.  If you want to include more text just include it in the file prior to the “” on the next line.

To edit your Theme’s 404 error template file:

1. Goto your WordPress Dashboard
2. Choose Appearances. Editor
3. Check to see if your theme includes a ‘404 Template’ in the list of files.
4. Click the link for ‘404 template’ along the right side of the page.
5. Edit the message text to say what you want it to say.
6. Save your changes.

Creating a new 404 Page

If your WordPress Theme does not include a template file named 404.php, you can create your own.  This will require a bit more knowledge on how to access the server where your site is located.
To use the 404.php template file from the WordPress Default Theme:

1. Copy the file /wp-content/themes/default/404.php into the directory of your current theme.
2. Then go back and edit the error message as described in the above section to present your desired error message.

Since each web host uses different tools we can’t walk you through this - just give you an overview of the process.

When you purchase a theme it should include a 404 page, all CW2 themes do, to give you an effective out the box solution.  However, you can always put a marketing spin to your 404 page and customize the message.

Related posts:

  1. WordPress Plugins for Page Management
  2. Wordpress Installation Guide
  3. Is it safe to use WordPress Plugins?
  4. WordPress Theme Tutorial in Pictures
  5. Build a Jobs Ad Website with WordPress!

Add to Technorati Favorites

Trackback

TrackBack URI for this entry

Comments (1)

  1. [...] 404 Error Page, Custom Search Result Page [...]

    Pingback by FREE Blogging Theme from CustomWeb2 — June 6, 2009 @ 11:26 pm

Write comment

Blog Latest Entry

Blog Categories

Blog Tags

Latest Blog Comments

CW2 Club Offer

Related Posts