How to customize your WordPress 404 page

I previous discussed how to customize your WordPress 404 page in a previous post, but I was brief.  This tutorial is intended to be a more comprehensive guide for this important customization step.  Customizing your 404 page tells your readers you went the extra mile to ensure they have a quality experience with your site.  Additionally, from an SEO perspective, users who need to take extra steps or “dig” to find your content are less likely to follow through.  They are also less likely to trust your site in search results in the future.

WordPress makes customization easy with logical theme files and template tags.  Here is how to leverage those features to customize your 404 page.  For those who don’t know, and I can’t imagine anyone reading Pingable that doesn’t, 404 pages are a catch-all page for any time a user stumbles upon content that does not exist.  Perhaps the URL has been changed, perhaps you’ve deleted the content, perhaps someone has incorrectly linked to a post.  The 404 page will be found by readers in these situations.

Step 1: Prevention

As they say, an ounce of prevention is worth a pound of cure.  The best way to improve the 404 error page experience is to prevent it entirely.  Here are some steps to prevent most 404 errors.

  1. Use Google Webmaster tools to track dead links and 404 messages.  Google’s huge brain knows how to tell when it has found a 404 page, and if Webmaster Tools has been set up for the domain, it will notify the owner via some nifty charts.  Find out who is linking to these incorrect URL’s and kindly ask them to update their link.  If the error is from inside your site, go through each one and correct the links.
  2. Check and re-check your internal links.  There is no reason you should be the source of errors.
  3. Use a search engine approved site map.  There are several good free plugins that automatically generate sitemaps for you.  This allows search engines to track your content quickly and efficiently.
  4. Internally link through the WYSIWYG hyperlink generator.  This uses post ID’s to create internal links so if the slug is changed, the link is not broken.
  5. Use a consistent url structure.  This is selected through the WordPress settings.  Whatever you choose, don’t change it once your site goes live.
  6. If you must move a post, consider deleting the content and replacing it with a link or 303 redirect to the new location.

 Customizing the WordPress 404 Page

  1. Find the 404 template file. In most WordPress themes, there is a file called 404.php.  This is the 404 error page.  Also in most themes, it will not be customized much.  Only super premium themes come with a custom styled 404 page.  If there is not a 404.php file, you can create one and place it in the theme directory.  WordPress will look for this file automatically and use it in the event of a 404 file not found error.
  2. Edit the file. The file can be edited with the built-in theme editor.  In the WordPress dashboard, go to Appearance > Editor.  Choose your theme and choose the 404.php file to edit.
  3. Choose your message. Make this message a little quirky, a little different, but be clear and concise.  Give users a next step like a search link or a link to the main page.  Apologize and tell them you will be checking into this error.  A little personality goes a long way.
  4. Give them more information. Even better than asking them to search is displaying information automatically.  This plugin will display search results similar to the document title they attempted to access.
  5. Go the extra mile.Make the design something memorable, and funny.  Humor is tied to memory anchors.  If a site makes you laugh, you are more likely to remember it in the future.  If you aren’t a designer, consider using a pre-designed 404 error page.  Here are some very inexpensive options.
  6. Need more? The following premium themes come with custom 404 pages.  If you’re feeling the need for a professional and cohesive design, this is the way to go.

Additional Resources

6 thoughts on “How to customize your WordPress 404 page”

  1. Thank you, that is a great article! I use a small tool to check the 404 errors of my websites – Screaming Frog SEO Spider; just Google it and you will find it. They also have a free version that will do the job perfectly for small and medium sized websites.

    Also, may I suggest the WordPress SEO by Yoast plugin as a great sitemap generator? Actually, that plugin does a lot more than that, so I am sure that your readers will love it.

    Finally, a small plugin that I have been using lately – 404 redirection. It’s a quick method to bypass the creation of 404 pages by redirecting all the broken links to your main website page. I only recommend it as a quick fix until you solve the problems properly, as highlighted by Dusty, but if you are only interested in making use of the backlinking power that would otherwise be wasted, you should definitely give this plugin a try.

  2. I know that 404 redirect plugin and it’s good for SEO and link juice but not so good for users. My 404 page explains why the reached the page and gives a search option, sitemap and link to the home page to help them find what they are looking for.

  3. Using a custom 404 page with instructions why a user get the error increases the user surfing experience. Always make available a link of your home page on your custom 404 page.

  4. How cool is that?! I seriously had no idea that 404 pages could be customizable. lol thanks, I have to try this one of this days 😛

  5. Hi. Also you could list your last 10 (or more) post in the 404 page. I have done it for my site. First I say that the page is missing and I give a search bar and then I list like the 15 most recent posts with their title, image, description :).

Leave a Reply

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