Protecting your blogger or wordpress blogs from spammers, clickers and other frauds have always been a major key point in any website designer life. If you are a blogger you will try to make your website safe from people you do not want to enter in your website or you do not want anyone to comment on your website, well I simply mean stopping unauthorized access to your website.
1. Go to Blogger > Template > Edit HTML
2. Now press </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.
(COMMENTS WILL LOAD AUTOMATICALLY)