404 error page

When browsing the web you might encounter a page that says “Sorry, the Page you were looking for in this blog does not exist”. This error is called “404 error page”, this page will appear when a visitor of a blog/site will try to visit a particular page that was already deleted or its URL was changed. When the Google crawler detects that there was a 404 error page on our blog it will try to delete it on Google search engine, assuming that the page was indexed. You may also use the Search Console if you try to look all the list of detected 404 error pages on your blog.

There is a big possibility that our visitors will leave our blog after seeing this kind of error, so one way to avoid to lose a potential visitors is by redirecting a 404 error page to the homepage, where visitors can see and read the latest posts of our blog before they leave.

Redirect 404 Error Page using JavaScript in Blogger

1. Go to your Blogger dashboard ->> Settings ->> Search preferences, then edit Custom Page Not Found.
2. Copy and paste the given codes below into empty text box and click Save Changes.
Sorry, the Page you were looking for in this blog does not exist.
You will redirected to homepage shortly.
<script type="text/javascript">
BSPNF_redirect = setTimeout(function() {
location.pathname= "/"
}, 5000);
You may also change the text that will appear on a 404 error page. If you created a 404 error page you may redirect onto that rather than redirecting to your homepage, just replace the pathname to href and / to the URL of the page. The redirection to the homepage will execute after 5 seconds and it is set on the above codes as 5000 milliseconds, you may change this according to your desired number. After setting anything you can now test by putting a non-existing url of your blog.


  1. This is very helpful. i go crazy if I see that message in my blog especially if I am scheduled to publish a book review. Thank you for sharing.

  2. This should be really helpful in case I encounter this error 404 problem.

  3. I encounter this error often. This tips really help a lot.

  4. this is a good tip, if Im not mistaken if we have a lot of this error this will also affect our google rank...not sure hahaha

  5. this should be handy especially for tech noob bloggers like myself! Those nasty 404 error messages can really give me stress, especially that I wouldn't know what to do to remove it!

  6. I'll try this with all of my blogs and thank you for posting this article. Really, I encountered this too.


NOTE - Every input is always appreciated. However, comments are always reviewed and it may take some time to appear. Always keep in mind URL without nofollow tag will consider a spam.