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.3. Now just press Save Template and refresh your blog to see the password asking popup.<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>