Routes file to *exclude* certain posts - not working as it should


I’m using the routes file to exclude certain posts from displaying on the homepage.

Here is what it looks like:
I added the highlighed line seen below

Next, I put the #noshow (ghost internal tag) on the post, as seen below:
(note the post URL)

Here is the problem:

  1. The URL changes on the homepage

  2. And… On click - it is a 404

I can’t figure what’s going wrong here.
Would appreciate some help. Thank you

I’m guessing your home template (or a partial it calls?) has a #get request in it that isn’t filtering out the tag. Because there’s no route set up for noshow pages but you’re displaying it anyway, Ghost can’t route it correctly.

Thanks Cathy,

Is there a way I could fix it?

Yes. You need to start with your home template (home.hbs, or index.hbs if there’s no home) and then work out what partial is doing the get request, and edit that get request to include a filter parameter!

I think I’ve found the right place.

Here is the existing code

{{#get 'posts' filter='featured:false' limit=@custom.number_of_recent_posts}}

How do I add another filter to also exclude the tag noshow ?


That didn’t work - but it set me on the right path.

This worked


(double quotes around the whole thing)

Thank you very much!

1 Like

Oops! Thanks for fixing my quotes! :)

1 Like