Fix WordPress Post Publishing Error - The White Screen and 404 Errors

Error 404 pages are where servers direct browsers when a URL seeks a missing page. While it’s easy to think you won’t really need a 404 page with a WordPress install, you’d be surprised. Even though all the links to the article or page you deleted are removed automatically from within your site, someone else might have created a link on their site to your post, which will no longer work.

That is what happens to me. I have shifted my blog to a new server and it’s creating a lot of problems for my blog. Most of the time this new server is down and I have to redirect my blog to my previous server which doesn’t have the latest posts.

Time needed: 5 minutes.

In order to create a custom 404 template file, follow these steps:

  1. Copy the contents of your page.php template file into a new template file
    named 404.php template file.

  2. You can remove the entire loop from the file.

  3. Place in some encouraging text and the PHP code to include the search.php template file:
    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that
    isn't here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>

  4. Add the #sidebarLT XHTML div and PHP WordPress template tag back in under the content div:
    <div id='sidebarLT">
    <?php get_sidebar();?>
    </div><!--//sidebarLT -->

These steps should give you a 404 error page.

Noor Mustafa Raza

Noor Mustafa Raza

I am a WordPress Developer and Designer, author @WPArena. I am providing Free WordPress consultation and can help you to install WordPress in a secure way to small businesses and bloggers.

Leave a comment

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