How to Create a Password Protected Page in Blogger?
Password Protected page is only possible in WordPress Blog but what about Blogger?
Can we protect certain page by adding password or not?
When I first began my tutorial blog in 2012 blogger was the most popular platform for me. However, because of its simplicity and less customization functionality, many people switch to WordPress after a few years. About the fact that Blogger is still constrained in many ways, most problems can be solved with a little study on the web. I'm comfortable with the Blogger platform and don't want to switch anytime soon!
I was trying to protect my several pages from restricting the visitors to visit but in Blogger platform hasn’t such things to protect it. Because Blogger doesn’t have Plugins for protecting any specific page. Either you have to add a password to the whole Blog or you have to make the Blog private. So our main objective won’t serve.
In WordPress Blog, we have seen Blog owner used password a protected page for delivering exclusive content to their VIP subscriber. Suppose you have written an eBook and now you want to deliver this eBook to your blog's subscriber-only.
In this case, you won’t able to restrict access of all visitors on Blogger. In this case, the Password Protected page work like charm. Because without a password your Blog’s subscriber won’t able to get access to the content’s page.
So Password Protected option is necessary. You can increase your Blog subscriber as well as your exclusive content will be protected from public access.
How to Secure a page on your Blog with a Password?
The password is required to unlock the shared blog material, even though the page is marked as "published." Afterwards, the password can be shared with your newsletter subscribers. They can log in to view new material on a daily basis.
Simply follow the instructions below to build a password-protected page and invite your customers to join your library!
Step #2: Click on -> Pages -> New Page-> Blank Page
Step #3: Now choose HTML view instead of Compose view and copy the below script and paste it on the page.
<script type="text/javascript">
/* Password Protection Script by www.bloggerspice.com*/
var password = 'BloggerSpice'
password=prompt('Please enter the password to enter this page:','');
if (password != 'BloggerSpice') {
location.href='PAGE URL HERE';
}
</script>
Customization
- Alter BloggerSpice with page password.
- Replace PAGE URL HERE with your page URL where you want to set a password.
For testing the password-protected page visit that page and see it is the required password to get access.
In this trick, I have used simple JavaScript and just you have to set a password and you can change the password according to your own. And remember about changing page URL. You should change the URL for applying the password.
In just 4 easy steps, you'll have a password-protected webpage! Now is the time to start creating a VIP Library of amazing content that your readers and potential subscribers would be compelled to subscribe to!
Happy blogging! Thank you.
48 comments
Tahir Habib | Tipricks
location.href='PAGE URL HERE';
Thank you
:-bd
^_^
I could set a passoword for a page, but people can still freely access the url in this location.href='PAGE URL HERE'; directly
Thank you
Probably in Mobile device URL changes. you will see at the end of the URL it shows m? for this reason it doesn't work in mobile device.
you try
it helps
thanks
I'm very glade to see you here. Thanks for dropping your comment.
Yes this is possible to create multiple password in a Blog, but you have to use separate page. For each page you can create different password. Thank you.
because when I did it the whole page became loked up
This tutorial is for adding password on single page. Just add the code on specific page that you want to protect by password.
in Blogger platform we can view the source code easily. So it is not possible to hide the password. Alternatively you can disable the right click and "ctrl + U" function
Thanks for the great idea. However encoded script can decode easily. But encoded script will increase the password security. :up
After removing the page password shouldn't appear. Because the password work only on that specific page. I think you did any other mistake.
Can you enter into page after deactivating the JavaScript or this is just disabling the JavaScript?