How to use filter to exclude a tag

I want to exclude a tag from my handlebars get statement. I could not find documentation on how to do it.

I have a tag called “Hidden” that I use for various website pages that I dont want displayed in tag lists.

Here is my current get statement:

{{#get "tags" limit="all" include="count.posts"}}

I want to do something like this:

{{#get "tags" filter="exclude:hidden" limit="all" include="count.posts"}}

Basically I think its really easy but cant find the syntax anywhere.

Your filter should look like this:


Here are a couple of useful resources:

Get Helper Filtering:

Some filtering examples (uses the Content API, but they’re still useful since the get helper uses the Content API internally)

NQL is the query language that’s used for filtering, here’s a syntax overview:


Re-opening this because i have another need. I am trying to figure out how to remove certain posts from the homepage (first and foremost).

If i use the tag #hidden the post is completely hidden, but i want it viewable still just not listed on the homepage.

I am using the ruby theme ( The problem I am running into now is, i could add this filter to the right #get statement but unfortunately I can not find a get statement related to the homepage content. Only #foreach nested inside .hbs files. Does anyone with knowledge of the Ruby theme know which .hbs file I should modify to affect the homepage loop? I cant seem to find the context for the homepage anywhere and where that is set so I can add the filter to it.

Anyone have any ideas on this?

The posts that are shown on the frontpage are processed by index.hbs, which in this specific Ruby theme includes the partial list.hbs

So, you can introduce your own #get statement in the list.hbs file by inserting it right before the foreach on line 7.

I tried wrapping the foreach statement in a get statement but now the context of my pages is screwed up. If I click the top navigation buttons on my site which link to a page with the corresponding tag. For example: vehicles link would list all posts with the vehicles tag. Now it lists ALL posts (minus the #hide tag). This is the get statement I used, i suppose i should remove limit=all?

{{#get "posts" limit="all" filter="tag:-hash-hide"}}

                        {{#foreach posts visibility="all"}}

                            <div class="post-column col-xl-4 col-md-6">

                                {{> "loop"}}



1 Like

The limit attribute only sets the size of the collection

The get statement on the tag page should include the tag id, otherwise it will indeed fetch all posts.

The default tag.hbs shows how that is normally done on line 10.

The filter attribute accepts multiple arguments in the follow syntax:

filter="tags:[tag1, tag2]"

I’m not really sure how to use that information to do this.

The issue is, if i add a get around the #foreach inside list.hbs then it changes the context for all pages using list.hbs to ALL tags. What i dont understand, is where the tag context comes from on subpages of my site that link to /tags/xxx/ How do those pages, which I think also use index.hbs, know to get only posts with that current page’s tag?

Another idea is, i could add a conditional, since really i only want to remove posts with the #hide tag from the homepage, they can stay on the sub-pages (tag pages).

so if i were to say something like:

#if current page is (root), then get + filter -#hide tag, else use the normal foreach statement (without the get statement).

In this case I think I would need to do two foreach statements as well, one with the get and one without the get based on the condition.

How would i do option b? Something like:

{{#if current_url=“”}}{{/if}}


There are two ways to get where you want.

You could use the is helper

{{#is "home"}}
  ... output something special for the home page ...
  ... output something different on all other pages ...

Or you could use the routing configuration to point the system to a dedicated template for the home page, and some other template for everything else. It is also possible to set filters on the routing level, instead of inn the get statements.

Awesome, thanks! Second option sounds maybe slightly better, but first option i think is closer to my abilities. I would like to learn more about how routing and custom templates work int he future though so will read about it, but for the sake of ease i will use the first suggestion. Thank you!