You have probably been surfing the internet and come across an “ERROR 404 Page Not Found” error hundreds of times. If visitors find them on your site, you are losing money. They see that page and either click on the back button or close the browser window. That does not have to be the case however, if you design a customised 404 error page for your site.
You can generally redirect your 404 page via your server. Make the page friendly and informative, and invite the visitors back to the site by offering a range of alternatives. You may wish to include a special offer you have available or redirect them to one of your profitable but interesting pages. What this does is keep the visitor on your website.
It also apologises for the inconvenience. Also gives then other options all of which should have your affiliate links embeded within them.
It only takes a few minutes of your time to create a custom 404 error page and reduces potential commission losses.
Creating an Error 404 Page
If your WordPress Theme does not include a template file named 404.php, you can create your own. Because every theme is different, there is no guarantee that copying over the 404.php template file found in the Twenty fifteen Theme will work, but it’s a good place to start. The error page you copy from the Twenty Thirteen Theme will adopt the style of the current theme because it actually calls the header and footer of the current theme. That’s less work for you, and you may only have to edit the message to suit your particular needs.
To use the 404.php template file from the WordPress Twenty Fifteen Theme: Copy the file /wp-content/themes/twentythirteen/404.php into the directory of your current theme. Then, edit the error message to present your desired error message.
If copying the default 404.php into your theme directory does not work well with your theme, you can also: Copy the index.php file of your current theme to a file called 404.php.
Open that file and delete all sections dealing with posts or comments, see The Loop.
Then, edit your 404 error message.
There are various improvements you can make to your 404 Error web pages so let’s look at some of your options.
Writing Friendly Messages
When an error message is displayed, you can say many things to help a visitor feel reassured they’ve only encountered a minor glitch, and you’re doing the best you can to help them find the information they want. You should also attempt to show the user what they want. Check out the AskApache Google 404 Plugin to add google search results to your 404.php
Or, say something shorter and sweeter. Almost anything you say is better than an error 404 Page Not Found. You can find more information about writing 404 Error pages on the Internet, like List Apart’s Perfect 404.
As an implementation of the Perfect 404 page, this solution will tell the user it’s not their fault and email the site admin. Helpful 404 page
When a visitor gets a 404 error page, it can be intimidating, and unhelpful. Using WordPress, you can take the edge off a 404 and make it helpful to users, and yourself, too, by emailing whenever the user clicks a link to a non-existent page.
Add Useful Links
If you encounter a “page not found” situation on the WordPress site, it is filled with helpful links to direct you to the various categories and areas of information within the WordPress site. Check it out at http://wordpress.org/brokenlink.php.
To add similar useful links to your 404 page, create a list, or a paragraph, so the visitor can easily determine which section might be useful to visit. Information of that nature is much better than having the user just reach a dead-end. To help you understand how to link to documents within your site, especially to Pages and Categories, see Linking_Posts_Pages_and_Categories.
Testing 404 Error Messages
To test your custom 404 page and message, just type a URL address into your browser for your website that doesn’t exist. Make one up or use something like:
This is sure to result in an error unless you actually have a php file called fred. If your error page doesn’t look “right”, you can go back and edit it so it works correctly and matches your Theme’s look and feel.
Help Your Server Find the 404 Page
By default, if WordPress cannot find a particular page it will look for the error 404.php web page. However, there may be cases where the web server encounters a problem before WordPress is aware of it. In that case, you can still guarantee that your web server sends the visitor to your 404.php template file by configuring your web server for custom 404 error handling.
To tell your web server to use your custom error files, you’ll need to edit the .htaccess file in the main directory (where main index.php file resides) of your WordPress installation. If you don’t have an .htaccess file, see Editing Rewrite Rules (.htaccess) on how to create an .htaccess file.
To ensure the server finds your 404 page, add the following line to your .htaccess file:
ErrorDocument 404 /index.php?error=404
The url /index.php is root-relative, which means that the forward slash begins with the root folder of your site. If WordPress is in a subfolder or subdirectory of your site’s root folder named ‘wordpress’, the line you add to your .htaccess file might be:
ErrorDocument 404 /wordpress/index.php?error=404