Skip to Content

Exclude a blog topic from a list of blog posts on HubSpot

⚠️ Note that this post hasn't been updated for at least a year and the information may be outdated, proceed with caution! (Last updated: September 29, 2019)

There are a few scenarios where you may wish to hide a specific blog topic from appearing in your posts, such as hiding blogs tagged as "featured" from your blog listings.

You can do this by using a condition that checks the topic name, like this:

{% raw %}{% for content in contents %}
  {% for topic in content.topic_list %}
    {% if topic.name != 'The Topic To Be Excluded' %}
      {# Add the markup for the rest of your posts here #}
    {% endif %}
  {% endfor %}
{% endfor %}

←  Previous Article

How to use HubSpot's Color field in custom modules

Next Article  →

Set your HubSpot topic or tag page title

Contact

Get help from a HubSpot CMS Expert

  • Custom HubSpot themes and reusable and easy-to-use HubSpot templates and modules
  • Technical support and guidance on the HubSpot CMS