# I need a strategy for filtering out posts from home page list

**URL:** <https://discourse.gohugo.io/t/i-need-a-strategy-for-filtering-out-posts-from-home-page-list/995>\
**Category:** support\
**Created:** [March 31, 2015, 9:25pm UTC](https://discourse.gohugo.io/t/i-need-a-strategy-for-filtering-out-posts-from-home-page-list/995 "2015-03-31T21:25:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jibbajabba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jibbajabba/32/354_2.png) [@jibbajabba](https://discourse.gohugo.io/u/jibbajabba)\
**Post date:** [March 31, 2015, 9:25pm UTC](https://discourse.gohugo.io/t/i-need-a-strategy-for-filtering-out-posts-from-home-page-list/995/1 "2015-03-31T21:25:01Z")

</div>

Hi, everyone. I’m looking for a strategy for filtering out posts from my home page list. I converted a site from Drupal over to HUGO and used the “promote to front page” flag to keep some posts from appearing on the front of my site.

I was thinking that I could create some type of status flag and for some posts would have that set to “not promoted” or something. I’m not sure I understand what the best approach would be for doing this.

I’ve tried creating a taxonomy using this in frontmatter:

```
promo = ["no"]

```

I’m finding it hard to figure out how to properly filter them out from my index listing. Is there a way to use a where statement that generates a list while filtering out results matching a term from a taxonomy? Or maybe someone has had a similar use case and has a better approach that they can suggest?

Thanks!

---

<div class="post-metadata">

**Author:** ![spf13](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/spf13/32/37_2.png) [@spf13](https://discourse.gohugo.io/u/spf13)\
**Post date:** [March 31, 2015, 9:41pm UTC](https://discourse.gohugo.io/t/i-need-a-strategy-for-filtering-out-posts-from-home-page-list/995/2 "2015-03-31T21:41:03Z")

</div>

See the list of functions on this page.

> **[Functions Quick Reference](http://gohugo.io/functions/)**
>
> Comprehensive list of Hugo templating functions, including basic and advanced usage examples.

Where is what you want. There are examples on that page.

---

<div class="post-metadata">

**Author:** ![jibbajabba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jibbajabba/32/354_2.png) [@jibbajabba](https://discourse.gohugo.io/u/jibbajabba)\
**Post date:** [March 31, 2015, 11:16pm UTC](https://discourse.gohugo.io/t/i-need-a-strategy-for-filtering-out-posts-from-home-page-list/995/3 "2015-03-31T23:16:39Z")

</div>

Thanks. That is indeed what I was staring at, but what I’m trying doesn’t seem to be right.

In config.toml I now have this:

```
[taxonomies]
  tag = "tags"
  status = "status"

```

In one post that I want to hide I include this for instance:

```
+++
title = "Nulo"
description = ""
tags = ["music"]
date = "2015-03-22"
status = "nopromo"
slug = "nulo"
+++

```

Finally, in my theme’s root index.html I have this which produces an empty list:

```
{{ range first 5 (where .Site.Recent "Params.status" "!=" "nopromo") }}
{{ .Render "list-node"}}
{{ end }}

```

It seems right if I’m understanding the docs, but I’m sure I’m missing something.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [March 31, 2015, 11:33pm UTC](https://discourse.gohugo.io/t/i-need-a-strategy-for-filtering-out-posts-from-home-page-list/995/4 "2015-03-31T23:33:15Z")

</div>

I would use `params` for this, which can take any types, like the bool `showOnFrontpage`.

---

<div class="post-metadata">

**Author:** ![jibbajabba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jibbajabba/32/354_2.png) [@jibbajabba](https://discourse.gohugo.io/u/jibbajabba)\
**Post date:** [April 1, 2015, 1:53am UTC](https://discourse.gohugo.io/t/i-need-a-strategy-for-filtering-out-posts-from-home-page-list/995/5 "2015-04-01T01:53:39Z")

</div>

Thanks, guys. I think I got what I need. Am just checking for {{ if not (isset .Params “nopromo” ) }} and that’s working fine although this is how I did it:

```
{{ range first 10 .Site.Recent }}
  {{ if not (isset .Params "nopromo" ) }}
    {{ .Render "list-node"}}
  {{ end }}
{{ end }}

```

It’s not ideal, because what I wanted was to show latest 10 posts, but I end up just subtracting any of those posts that have the nopromo param.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [April 1, 2015, 2:18am UTC](https://discourse.gohugo.io/t/i-need-a-strategy-for-filtering-out-posts-from-home-page-list/995/6 "2015-04-01T02:18:26Z")

</div>

I think you should read the above posts again, esp. the ones about `where`.
