change wordpress permissions in password protected website code example
Example: password protected website wordpress
In Wordpress by default there is a option for adding password to the page, just
change the "status & visibility" option from public to password protected