Pretty 404 pages on WordPress

Since my Web site was created, it ran various rendering software ; each of those generated URL that Google sometimes seems to remember. Many of those URL aren’t relevant nowadays ; although the information may still be there on the Web site.
Here’s how I deal with the “404: Page not found” error on WordPress:

  • Go to the WordPress administration page and browse to the extensions section ;
  • Grab and install the AskApache Google 404 plugin ;
  • Activate the plugin and browse to its settings section.

I choose to use the askapache-google-404/404.php file as the “404.php Template File”.
I also enabled the Track Errors with Google Analytics option.
Finally, from the HTML Editor section, I defined a personal rendering ; mainly to not show every proposed information and to match my theme. I used the following code:

<h3>Related Posts</h3>
<div id="g404ajax">
 <div id="sFormDiv">Loading...</div>
 <div id="gDiv"></div>
 <div id="lDiv"></div>
 <div id="rDiv"></div>
 <p style="clear:both;"></p>

Now, any URL is rendered in a nice manner.

That’s All Folks!

Author: Joel Carnat

@work Technical Architect and SysAdmin ; @home OpenBSD and FOSS, Karate, Kobudō, Jōdō, Bodyweight workout, Photography & Music

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.