Well
 today we are going to teach you how you can easily add a password to 
your blogger or wordpress blog and when ever a person pumps in your 
websites address he will be greeted with a password prompt dialog, where
 he have to enter the password kept by you if he fails to enter the 
password then he will be redirected to your desired website.  
1. Go to Blogger > Template > Edit HTML
2. Now press Ctrl + F and search for the 
</body> tag and add below code above it.
<script>
var password = 'Password-Here'
password=prompt('Please enter the password to enter this site:','');
if (password != 'Password-Here') {
location.href='Redirect-URL-Here'}
</script>
3. Now just press Save Template and refresh your blog to see the password asking popup.
Customizations : 
You
 can change the password according to your wish, just change the letters
 in red color to your password. You can add any URL to which the visitor
 will be redirected if he enters the wrong password or cancel to add any
 password, just change the Blue line in the above code with your URL.
 





 
 
 
 
 
 
 
 
 
 
 
Perfect. Concise and direct and worked like a charm. Thank you so much.
ReplyDeleteyou are welcome, thanks its works for u and 4 commenting
DeleteThis works a little TOO well! Is there any way to make it so that they don't have to enter a password more than once? As it is now, they have to reenter the password to view every page/post that requires clicking a link (like the various pages/tabs at the top or even just "older posts")
ReplyDeletethis just for personal blogs.
DeleteI did 'Ctrl + F' to search for the tag, but nothing came up. Any suggestions? Thanks for sharing.
ReplyDeletemake sure you followed the instructions. it's simple .just copy the tag and press ctrl+f.
DeleteYour this article is really good. Your work is really inspiring and informative thanks for share such a nice blog.
ReplyDeleteaccess FileCrop in UK
thanks for your compliments.....am grateful.
DeleteThere are currently over 400 million registered users on Facebook worldwide, 100 million of them live in United States.
ReplyDelete