# Avoid duplication for displaying blog post if it has multiple tags

**URL:** <https://community.hubspot.com/t/avoid-duplication-for-displaying-blog-post-if-it-has-multiple-tags/8747>\
**Category:** CMS Development\
**Created:** [May 7, 2018, 6:06am UTC](https://community.hubspot.com/t/avoid-duplication-for-displaying-blog-post-if-it-has-multiple-tags/8747 "2018-05-07T06:06:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![swapnilmr](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/swapnilmr/32/1529_2.png) [@swapnilmr](https://community.hubspot.com/u/swapnilmr)\
**Post date:** [May 7, 2018, 6:06am UTC](https://community.hubspot.com/t/avoid-duplication-for-displaying-blog-post-if-it-has-multiple-tags/8747/1 "2018-05-07T06:06:08Z")

</div>

I’m displaying multiple posts on my Website Page with the help of custom module. I’m pulling post with the help of following code:

```auto
{% set topic_one = blog_recent_topic_posts('BLOG ID', topic_name_1, 10) %}
{% set topic_two = blog_recent_topic_posts('BLOG ID', topic_name_2, 10) %}
{% set topic_three = blog_recent_topic_posts('BLOG ID', topic_name_3, 10) %}

{% set topic_posts = (topic_one + topic_two + topic_three)|sort(true, false, 'publish_date') %}{% for topic_post in topic_posts %}Post content{% endfor %} 

```

The problem is, if the blog post has both topic\_one and topic\_two tagged, then that blog post will get displayed twice. I want to avoid this duplication. Can anyone help me with this?

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [May 7, 2018, 7:51pm UTC](https://community.hubspot.com/t/avoid-duplication-for-displaying-blog-post-if-it-has-multiple-tags/8747/2 "2018-05-07T19:51:44Z")

</div>

Use the unique Hubl filter

```auto
{% for topic_post in topic_posts|unique %}
Post content
{% endfor %}

```

I’ve had this issue before and I am pretty sure that is how I got it to work.

---

<div class="post-metadata">

**Author:** ![swapnilmr](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/swapnilmr/32/1529_2.png) [@swapnilmr](https://community.hubspot.com/u/swapnilmr)\
**Post date:** [May 15, 2018, 10:21am UTC](https://community.hubspot.com/t/avoid-duplication-for-displaying-blog-post-if-it-has-multiple-tags/8747/3 "2018-05-15T10:21:02Z")

</div>

Thank you, this works!
