1. Go to Blogger > Template > Edit HTML
2. Now press Ctrl + F and search for the </body> tag and add below code above it or you can add it to specific post or page.
<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.
0 comments:
Post a Comment