Ways to do not open some posts to the public


Should all the posts be opened to the public?

I do not want to let some my posts to be seen by the public, but I do not know how to do it.
I understand that there is a variable “draft”, but this is not the one I am finding as the post with draft=true will not uploaded on my website; I want to let myself to read it on my website.
To note, what I want is to close some posts, not the website entirely.

In addition, it will be great if there are some ways to select addresses or people that I want to open my posts. For instance, I want to open post A to the public, post B to three people (a, b, and c), and post C only to myself.

Currently I am using the Zzo theme.

Thank you

You can protect posts or pages with .htaccess in Apache, but you will also need to disallow those same posts/pages in the sitemap and RSS feed.

Or, take a look at encryption: https://github.com/Li4n0/hugo_encryptor

See also How can i create a private post?

Hugo generates static files. The functionality you are looking for is using a web server or additional web software.

Thank you for the responses and links.

I have found out that the function I want was discussed about 4 years ago, and have not deveoped yet.

I may have to look into the encryption shorcode or where clause.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.