> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.unicornplatform.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Password protected pages

This guide will show you how to create a simple password protection for your pages.

![](https://storage.crisp.chat/users/helpdesk/website/7e782a40c0560c00/image_w044c5.png)

#### Step 1/4

Copy this code:

```
<style>
   body{
   visibility: hidden;
   }
</style>
<script>
   function do_check(){
       var password = 'test';
       var return_value=prompt("Password:");
       if(return_value == password) {
           document.getElementsByTagName("BODY")[0].style.visibility = "visible";
       }
       else {
           setTimeout(()=>{
               alert('This website is protected with a password. Reload the page and try again.');
           }, 200)
       }
   }
   window.addEventListener("DOMContentLoaded", () => {
       setTimeout(do_check, 500)
   })
</script>
```

#### Step 2/4

Create a **Custom HTML** component on the page that you want to protect with a password.

![](https://storage.crisp.chat/users/helpdesk/website/7e782a40c0560c00/image_1og89ie.png)

#### Step 3/4

Paste the code inside.

![](https://storage.crisp.chat/users/helpdesk/website/7e782a40c0560c00/image_m6da49.png)

#### Step 4/4

Replace this line with your own one (make sure to keep the quotes). This will be your password.

![](https://storage.crisp.chat/users/helpdesk/website/7e782a40c0560c00/image_1nwi270.png)

#### Done!

Save changes and open the live version of your website to see the results 🔒

PS: If you want to set a password for all pages, simply paste the code from step 1 into the **Settings** -> **General settings** -> **Global <body> HTML code:**