Filter out posts by tag on homepage

Hello! I’m a newbie to ghost and not very advanced with coding either… That said, in the Liebling theme, I would like posts of a certain tag to NOT be displayed in the loop on the homepage, but just on the “tag page”. Is there a simple way to do this? Thank you!

Hi @jonahl,

welcome to ghost community :smiley:

You can do that via the routes.yaml in your Ghost Admin > Settings > Labs:

  1. Download your routes.yaml
  2. Add a filter under collections, like shown in the screenshot:
    image
    tag = means you want to filter by tag
    -yourcustomtag = means, that posts with yourcustomtag get excluded.
    You can combine multiple tag filters, by adding a plus sign
    Make sure to add the hyphen before your tag, otherwise your page will only show posts with that certain tag

More info in the ghost docs:

Let me know if you need help :stuck_out_tongue:

1 Like

Hey, @daniel1. Thank you so much, that works! I really appreciate it—I feel like a new world has been opened up… :wink: :raised_hands: