# \[solved\] Hidden posts

**URL:** <https://zola.discourse.group/t/solved-hidden-posts/455>\
**Category:** Feature requests\
**Created:** [June 11, 2020, 11:21am UTC](https://zola.discourse.group/t/solved-hidden-posts/455 "2020-06-11T11:21:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [June 11, 2020, 11:21am UTC](https://zola.discourse.group/t/solved-hidden-posts/455/1 "2020-06-11T11:21:29Z")

</div>

# Feature proposal

Add a new property that allows post to be hidden from discovery by any means except the direct link

# Use cases

Users might want to publish a post privately if:

- Post contains personal or sensitive data
- Post targets a small group of people and doesn’t make sense for the rest of the internet
- Author wants to discuss post with someone before publishing, so now the link can easily be shared

# Implementation

We can introduce a new post property:

```auto
+++
...
hidden = true
...
+++

```

If this option is set to `true`, then post will **NOT** be listed in:

- List of posts
- Pagination
- `previous` and `next` properties of neighbor pages
- RSS feed
- taxonomies

So, the only option to access it would be a direct link.  
Such links can be printed to stdout after site generation process.

What do you think? Do you find it useful?

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [June 11, 2020, 11:24am UTC](https://zola.discourse.group/t/solved-hidden-posts/455/2 "2020-06-11T11:24:43Z")

</div>

Why not move it out of a paginated section if it’s not meant to be in there? Eg make a hidden section that is not linked anywhere and hidden in the sitemap.  
The usecase for having that inside a public section is too niche to be worth it imo

---

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [June 11, 2020, 4:31pm UTC](https://zola.discourse.group/t/solved-hidden-posts/455/3 "2020-06-11T16:31:56Z")

</div>

Indeed, that will cover 100% of what I need 🙂  
Thank you!

---

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [July 15, 2020, 1:04pm UTC](https://zola.discourse.group/t/solved-hidden-posts/455/4 "2020-07-15T13:04:25Z")

</div>

@keats, sorry for bumping the solved post, but suggested solution does not prevent the post being added to a generated atom feed. Maybe you have an idea how to prevent that?

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 19, 2020, 3:02pm UTC](https://zola.discourse.group/t/solved-hidden-posts/455/5 "2020-07-19T15:02:17Z")

</div>

You can override the feed template ([https://github.com/getzola/zola/blob/master/components/templates/src/builtins/atom.xml](https://github.com/getzola/zola/blob/master/components/templates/src/builtins/atom.xml)) and just add a check to not add hidden pages to it.

---

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [July 19, 2020, 3:25pm UTC](https://zola.discourse.group/t/solved-hidden-posts/455/6 "2020-07-19T15:25:46Z")

</div>

I tried that, unfortunately it looks like I can’t access custom header variables (`hidden = true`) from the template. Nor [Feeds](https://www.getzola.org/documentation/templates/overview/) nor [Sections and Pages](https://www.getzola.org/documentation/templates/pages-sections/) doc sections give details on how to access it. There is an `extra` variable, but is also doesn’t seem to have custom fields. Maybe you have any example in mind?

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 20, 2020, 9:44am UTC](https://zola.discourse.group/t/solved-hidden-posts/455/7 "2020-07-20T09:44:52Z")

</div>

Try `page.extra.hidden` if it’s in the `extra` section

---

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [July 20, 2020, 4:40pm UTC](https://zola.discourse.group/t/solved-hidden-posts/455/8 "2020-07-20T16:40:52Z")

</div>

Thank you, I read that `extra` is a HashMap, so I was trying to do something like

```auto
page.extra['hidden']

```

🤦‍♂️

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 20, 2020, 5:08pm UTC](https://zola.discourse.group/t/solved-hidden-posts/455/9 "2020-07-20T17:08:53Z")

</div>

Well that should work in theory x) it should be equivalent to `page.extra.hidden`

---

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [July 22, 2020, 6:36am UTC](https://zola.discourse.group/t/solved-hidden-posts/455/10 "2020-07-22T06:36:10Z")

</div>

A followup for the history sake: I ended up putting “hidden” pages inside `/content/hidden` and creating `/templates/feed.xml` with the following content:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
	<title>{{ config.title }}
		{%- if term %} - {{ term.name }}
		{%- endif -%}
	</title>
	{%- if config.description %}
	<subtitle>{{ config.description }}</subtitle>
	{%- endif %}
	<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
	<link href="{{ config.base_url | safe }}"/>
	<generator uri="https://www.getzola.org/">Zola</generator>
	<updated>{{ last_updated | date(format="%+") }}</updated>
	<id>{{ feed_url | safe }}</id>
	{%- for page in pages %}
        {%- if page.components is not containing("hidden") %}
        <entry xml:lang="{{ page.lang }}">
            <title>{{ page.title }}</title>
            <published>{{ page.date | date(format="%+") }}</published>
            <updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated>
            <link href="{{ page.permalink | safe }}" type="text/html"/>
            <id>{{ page.permalink | safe }}</id>
            <content type="html">{{ page.content }}</content>
        </entry>
        {%- endif %}
	{%- endfor %}
</feed>

```

The benefit here is that you don’t have to remember to put something in a page header, just keep it in the corresponding folder.

Thanks for you help again, @keats! You are doing such an amazing job here!

---

<div class="post-metadata">

**Author:** ![ufukayyildiz](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/ufukayyildiz/32/1464_2.png) [@ufukayyildiz](https://zola.discourse.group/u/ufukayyildiz)\
**Post date:** [May 25, 2025, 5:10am UTC](https://zola.discourse.group/t/solved-hidden-posts/455/11 "2025-05-25T05:10:33Z")

</div>

Hi @keats

what should be in config.toml file exactly?  
i tried `page.extra.hidden = true` 🙂 but did not work.  
and added` hidden = true` in page.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [May 28, 2025, 7:36pm UTC](https://zola.discourse.group/t/solved-hidden-posts/455/12 "2025-05-28T19:36:06Z")

</div>

In the post front-matter

```toml
...
[extra]
hidden = true

```
