How can I exclude tags when I want to show the tag lists?


#1

I am trying to exclude some tags from my tag lists. I used it before but when I updated my ghost and ghost-cli with latest version (2.11.1), the tags exclude is not working.

I am trying to do with this code but it is not working

{{#get "tags" filter="tags:-[purple]"}}
   {{#foreach "tags"}}
       <li><a href="{{url}}">{{name}}</a></li>
   {{/foreach}}
{{/get}}

#2

I think you have a typo.

{{#foreach “tags”}}

Must be

{{#foreach tags}}

Let me know if it works.


#3

If I use this, it shows all tags. But I want to exclude the “purple” tag or like this which I use in the array notation.

{{#get "tags" filter="tags:-[purple]"}}
   {{#foreach tags}}
       <li><a href="{{url}}">{{name}}</a></li>
  {{/foreach}}
{{/get}}

#4

#5

You have to use e.g.

{{#get “tags” filter=“slug:-purple”}}


#6

Great :blush: Thank you so much