Friday 30 March 2012

Password Protecting your Blogger Blog

| |

                                                                                                                 

Have you wanted to password protect your Blogger blog?  In this past post on building Membership Sites, we discussed a Password Protected "page" and in it discuss the existing ways to protect a site. In Blogger, this was different from TypePad and WordPress, as instead of providing a password, you instead manually "invite" people to a blog you want "private" and viewed by only those you invite.
That solution works for many, but the traditional password protection is much more desired.  So in helping a customer set this up in her Blogger blog, I thought I'd share the solution with you!
Familiarize yourself with password
protection.
First, read this past post on password protected site and pages. You will be using the code there in this mini-tutorial. You may also find it here.
Next, some prep work!
  • Create a New Page on your Main Blog.
    • If you are password protecting Blog B which is a family blog for example, then in your main blog, Blog A, you may wish to create a "page" thats entiled "Password Needed" and in that page you write a simple note explaining that "The blog you were trying to view is password protected. If you feel you are reaching this message in error, please contact me at <your email address>."
    • Publish the page (no gadget to be added).
    • View Page to get the URL.
  • Save/Note this URL as you need it in the following steps.
Put into action!
Next, login to Blogger, go to the Dashboard and click Design.  If using the new Blogger interface, then go to your blog and click on Layout (from the left).
Next, click Add a Gadget and choose HTML/JavaScript.
Copy and paste in this code in the large text box (leaving the title blank):
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var password = 'somesh'
password=prompt('Please enter the password to enter this site:','');
if (password != 'TypePad') {
location.href='http://www.coolstuff.us.ms';
}
// End -->
</SCRIPT>

Edit this code.
  • Change the occurances of the word somesh with whatever password you want to use.
  • Replace the URL of
    http://www.coolstuff.us.ms
    with the URL from the page you previously created above in the prep work area.
In the HTML/JavaScript gadget, click Save to save the code.
That's it, you're done! Your site is now password protected and they will need the password to get in.
IMPORTANT NOTES:
When logging into your Blogger blog, do so from the main blogger site, http://www.Blogger.com.  This will allow you to login and access your blogs in case you accidentally put the code in the wrong place or on the wrong blog.
If you get stuck, feel free to post a comment here as others can benefit from your questions and answers :D

Password Protecting your Blogger Blog


Related Posts Plugin for WordPress, Blogger...
Powered by Blogger.