How to Redirect 404 Error Page to Homepage in Blogger

404 error page (Page Not Found) is part of every website and blog. According to Wikipedia, “The 404 or Not Found error message is a HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested.”


A non existing page on a website/blog will result to a 404 error page and this might give first timer a wrong impression about your blog. So the best solution to this type of situation is to redirect your blog 404 error page to your blog home page or a certain page on your blog. This can be done by adding a simple piece of JavaScript code to your blog. Follow the procedure outlined below to redirect your blogger error 404 page to homepage.

==> Log in to your Blogger Dashboard, then go to Settings >> Search Preferences >> Custom Page Not Found (Under Errors and redirections).


==> Click on edit, paste the code below into the box and then Save changes

Sorry, the page you were looking for in this blog does not exist. You will be redirected to homepage shortly.
<script type = "text/javascript">
//Blogger 404 Redirect v1.0 by Olusegun(
JN_redirect = setTimeout(function() {
location.pathname= "/"
}, 5000);

Customizing the Redirection Code

  • • You can change the message on the top (i.e. Sorry, the page you were looking for in this blog does not exist. You will be redirected to homepage shortly) to anything you like
  • • The 5000 in the code represents delay in milliseconds. You can change the 5000 to any value. Changing the value to zero simply means your 404 error page will be redirected to your homepage or any desired page without any delay.
  • • If you are willing to redirect your blog 404 error page to another page other than your home page, just replace pathname to href and / to the url of the page.

I love sharing my knowledge with others. Feel free to contact me with any questions you may have. Please subscribe to the newsfeed and get updates through email, share this article with friends, or leave a comment below. New users can read about me HERE

Share this on:Share on Facebook2Tweet about this on TwitterShare on Google+1Pin on Pinterest0Share on StumbleUpon1Digg this


  1. Hi Olusegun

    I don’t know much about 404 error pages because I had started my blogging career recently.

    But somewhere I read that If any blogger or writer deleted the existing web page then the URL of that web page becomes 404 URL and that page becomes 404 page.

    It is also said that Google don’t like 404 page so I checked my site whether I had any 404 page or not then I found few of the 404 error pages on my site also.

    But Now after reading this post, I can easily handle these pages.

    Thanks for sharing such a helpful post with us. 😀

  2. hi, what if I just type my blog addres in there?

    isn’t it redirect?

    please answer

    thank you

  3. elusoji sodeeq says:

    hi mr Fapohunda.i rily like your posts and tutorials.. you have really bn an inspiration to me..av bn followin your site sins 2011 but av not bn able to set up my.but now am ready.d site is for d inspirational and educating information.

  4. Thanks a lot for the tutorial, it has simplified things for me

Tell us what you're thinking...

All comments are moderated.

* Denotes required field.