Helplogger Blogger tips, tricks, tutorials and widgets.
  • Home
  • about
  • contact
  • Sitemap

Redirect Blogger 404 Error (Page Not Found) To Homepage

Posted by Manthan in: How to
A 404 error page tells you and search engines that a page is not found by displaying a text similar to it "Sorry, the page you were looking for in this blog does not exist.". This may happen because you have changed your URLs over time, either removed a few pages when you overhauled your design or a visitor may have accidentally misspelled an URL inexistent in your blog, so it automatically redirects to the 404 error page (page not found).
how to redirect blogger 404 error to homepage
And probably this will not make a good impression on the greatest potential users of our blog. Before the user clicks the back button or close the window/browser's tab, thus leaving our site forever, we may want to redirect 404 error in Blogger to a page, where are chances that the visitor will continue reading our blog.
One of the most used methods is the "meta refresh" but the problem with this method is that it breaks navigation (doesn't allow to return back). In this case, the best method is by using Javascript about which I will go in detail below.

Redirect Blogger 404 Error with Javascript


Go to your Blogger dashboard, select your blog and then to Settings > Search preferences > Custom Page Not Found.

redirect 404 error page in blogger to homepage

Copy and paste the following code inside the empty box:
Sorry, the page you're looking for in this blog does not exist.
You will be redirected to homepage shortly.
<script type = "text/javascript">
BSPNF_redirect = setTimeout(function() {
location.pathname= "/"
}, 5000);
</script>
The message which is going to be displayed can be modified as you want. 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 / with the url of your page. And finally, the number 5000 which is the delay expressed in milliseconds, can be changed to other value if this is more convenient.

Next thing to do is to Save all changes made in this section and do a little test to check if the code works well. You can verify the 404 error page functionality by adding a custom text at the end of your blog address and after hitting Enter, you should see the error page followed by a redirection after 5 seconds. That's it!

1 comment:

  1. Blogger24 December 2021 at 04:55

    This information is very useful for me as a blogger blog user. Thank you for sharing.

    Regards.
    Emily Addison

    ReplyDelete
    Replies
      Reply
Add comment
Load more...

Newer Post Older Post Home

About Manthan Dudeja

Manthan dudeja Manthan dudeja is the founder of Helplogger, He is a young Blogger ,Web Designer, Graphic Designer and owns his popularity to the fact that he posts genuine contents to his blog and believe in good rituals. He is young and truly innovative in his work At helplogger he mostly writes about How to blog tips, Tech news, Gadget Reviews etc. Countinue Reading

Popular Posts

  • (no title)
    Dual whatsapp Happy Diwali SMS Happy Diwali Whatsapp Status, SMS, Messages and Wishes Happy Diwali Shyari in Hindi Happy Diwali Shyari...
  • Add a forum on your Blogger blog with Nabble
    Forum is a platform where visitors can interact with each other and discuss different hot topics. There you can add desired topics for getti...
  • Happy Veterans Day 2016
    Happy Veterans Day Quotes, Messages, Card Sayings, Thank You Giving Veterans Day Wallpapers Images Photos 2016
  • Add Floating Social Media Sharing Buttons To Blogger
    The Floating Social Media Sharing is a very popular widget on all the top blogs and this is one of the ways to increase the number of times ...
  • Related Posts Widget with Thumbnails and Summary for Blogger
    There are several tutorials quite old in which I have shown different methods for displaying related posts in Blogger [ 1 ] [ 2 ] but in th...

About This Blog

Helplogger.in is a blog for Tech Geeks and Bloggers where we share fresh and updated information related to Internet, Social Media, Gadgets, Blogging, How-To Guides, Internet Marketing, SEO and much more related to Technology. You can check out about the admin of the blog here and check out our Sitemap.

Quick Navigation

  • Home
  • About Us
  • Contact Us
  • Privacy Policy

Follow Manthan Dudeja

Follow us on Facebook Follow us on Twitter Follow us on Google+

"© Copyright 2014-2016" · All Rights Reserved · And Our Sitemap · All Logos & Trademark Belongs To Their Respective Owners·
Website designed by Manthan dudeja.