If you're using the blogger website and finding a way to lock your blog post using passkey then you're at the right place.
Hello everyone,
In this blog post we're going to discuss on How to Lock Blog Post in Blogger? All you have to do is follow the steps properly as described.
How to Lock Blog Post in Blogger?
Locking posts on the blogger website requires some codes to be implemented on it. But don't worry below are some steps to add it.
- Firstly, go to that post inside which you want to add a password.
- Copy the below Source Code and add it to the HTML View of your blog post.
Source Code
<!--Lock Post--><!--Powered by theAShub--> <script language="JavaScript"> <!--Begin var password = 'theashub' password=prompt('Please enter the passcode to open it !',''); if (password != 'theashub') { location.href='https://www.theashub.com/'; alert("Wrong password ! you will redirect to homepage") } // End --> </script>
Now save it, and you're done.
Understanding the Source Code
var password = 'theashub'
- This section contains your password.
password=prompt('Please enter the passcode to open it !','');
- This is the message shows at the time asking password.
location.href='https://www.theashub.com/'
- In case of wrong password entered, it will redirect to this link.
Is it necessary to lock blog posts in Blogger?
It totally depends upon your need, like if you're sharing some paid content or private information, which requires some layer of security. Therefore, in such a case, locking that blog post is compulsory.I hope this post has resolved your problem. Still have any questions? Let me know in the comment section.