Does HubSpot’s Blog Have a Category Function?

TMisuna
Contributor

I know that HubSpot’s blog has a “tag” feature, but does it also have “categories”?
In WordPress, there are two taxonomies: categories and tags, each with different hierarchy levels.
Is it correct to assume that HubSpot CMS simply doesn’t provide a category feature?

If categories don’t exist in HubSpot, that’s fine. I just want to confirm.

Also, when blog tags are written in Japanese, the slugs automatically become Japanese as well.
Is there any way to change or control these slugs?
If I’m using the Professional plan, is using the API the only workaround?

0 Upvotes
2 Accepted solutions
evaldas
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Hi @TMisuna,

 

Correct, HubSpot does not have a separate "category" feature - it only has the "tags", which also does not have a hierarchy feature.

 

There is a section in the UI for managing tags but there isn't an option to allow editing the slugs. 

 

https://app.hubspot.com/blog/{YOUR_PORTAL_ID}/manage/tags

 

Looking at the API docs, it also does not look like there is an option to set the slug for a tag:

https://developers.hubspot.com/docs/api-reference/cms-tags-v3/blog-tags/patch-cms-v3-blogs-tags-obje...

 

It might be something that is generated dynamically by the system based on the name of the tag.

✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

BarryGrennan
Solution
Key Advisor

Just to add, there are hacks you can use to replicate seperate taxonomies.

 

In your case you could create tags prepended by the word "Category" and then filter anywhere you need to use them.

So in your tags you'd have something like:
Red Shoes
Green Shoes
Blue Shoes
Category Trainers
Category High Heels

Then wherever you're using the tags or categories oyu'd use something like

{% set my_tags = blog_tags('default', 250)|sort(False, False, 'name') %}
  
Categories
{% for item in my_tags %}
{% if item.name contains "Category" %}
 <a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item.name|replace('Category','')|trim }}</a>
{% endif %}
{% endfor %}

Tags
{% for item in my_tags %}
{% unless item.name contains "Category" %}
 <a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item.name }}</a>
{% endif %}
{% endfor %}


I use something like this on my own blog to set up nested categories.

 

{% set my_tags = blog_tags('default', 250)|sort(False, False, 'name') %}
  {% set displayed_sections = [] %}
  {% set no_prefix_tags = [] %}
    
  {% for item in my_tags %}
    {% if item.name[:1] == "#" %}
        {% set prefix = item.name|split(' ') %}
        {% set prefix = prefix[0]|replace('#', '') %}

        {% unless prefix in displayed_sections %}
            <div class="mt-11 border-t-2 border-black-10 border-solid pt-[18px] mb-[18px] lg:mb-8">
                <div><h3 class="tag-title">{{ prefix }}</h3></div>
                {% do displayed_sections.append(prefix) %}
      
        {% endunless %}

        <a class="tags_2024" href="{{ blog_tag_url(group.id, item.slug) }}">{{ item.name|replace('#' ~ prefix, '')|trim }}</a>
        {% if loop.last %}</div>{% endif %}
    {% else %}
        {% do no_prefix_tags.append(item) %}
    {% endif %}
{% endfor %}

{% if no_prefix_tags|length > 0 %}
    <div class="mt-11 border-t-2 border-black-10 border-solid pt-[18px] mb-[18px] lg:mb-8">
        <div><h3 class="tag-title">Other</h3></div>
        {% for item in no_prefix_tags %}
            <a class="tags_2024" href="{{ blog_tag_url(group.id, item.slug) }}">{{ item.name|trim }}</a>
        {% endfor %}
    </div>
{% endif %}


That's a bit more complex, but it means I can set up a new top level category just by starting a tag with a '#'.
So my tags look like:

#Hubspot Development

#Hubspot React
#Wordpress Ubermenu

etc.

Then anything without a # gets caught by the "Other" section.

The one user facing drawback is the url still isn't editable, but ¯\_(ツ)_/¯


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

 

 

 

View solution in original post

4 Replies 4
BarryGrennan
Solution
Key Advisor

Just to add, there are hacks you can use to replicate seperate taxonomies.

 

In your case you could create tags prepended by the word "Category" and then filter anywhere you need to use them.

So in your tags you'd have something like:
Red Shoes
Green Shoes
Blue Shoes
Category Trainers
Category High Heels

Then wherever you're using the tags or categories oyu'd use something like

{% set my_tags = blog_tags('default', 250)|sort(False, False, 'name') %}
  
Categories
{% for item in my_tags %}
{% if item.name contains "Category" %}
 <a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item.name|replace('Category','')|trim }}</a>
{% endif %}
{% endfor %}

Tags
{% for item in my_tags %}
{% unless item.name contains "Category" %}
 <a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item.name }}</a>
{% endif %}
{% endfor %}


I use something like this on my own blog to set up nested categories.

 

{% set my_tags = blog_tags('default', 250)|sort(False, False, 'name') %}
  {% set displayed_sections = [] %}
  {% set no_prefix_tags = [] %}
    
  {% for item in my_tags %}
    {% if item.name[:1] == "#" %}
        {% set prefix = item.name|split(' ') %}
        {% set prefix = prefix[0]|replace('#', '') %}

        {% unless prefix in displayed_sections %}
            <div class="mt-11 border-t-2 border-black-10 border-solid pt-[18px] mb-[18px] lg:mb-8">
                <div><h3 class="tag-title">{{ prefix }}</h3></div>
                {% do displayed_sections.append(prefix) %}
      
        {% endunless %}

        <a class="tags_2024" href="{{ blog_tag_url(group.id, item.slug) }}">{{ item.name|replace('#' ~ prefix, '')|trim }}</a>
        {% if loop.last %}</div>{% endif %}
    {% else %}
        {% do no_prefix_tags.append(item) %}
    {% endif %}
{% endfor %}

{% if no_prefix_tags|length > 0 %}
    <div class="mt-11 border-t-2 border-black-10 border-solid pt-[18px] mb-[18px] lg:mb-8">
        <div><h3 class="tag-title">Other</h3></div>
        {% for item in no_prefix_tags %}
            <a class="tags_2024" href="{{ blog_tag_url(group.id, item.slug) }}">{{ item.name|trim }}</a>
        {% endfor %}
    </div>
{% endif %}


That's a bit more complex, but it means I can set up a new top level category just by starting a tag with a '#'.
So my tags look like:

#Hubspot Development

#Hubspot React
#Wordpress Ubermenu

etc.

Then anything without a # gets caught by the "Other" section.

The one user facing drawback is the url still isn't editable, but ¯\_(ツ)_/¯


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

 

 

 

TMisuna
Contributor

I see—that approach hadn’t occurred to me at all.
So you're referring to the method where it technically goes into HubSpot’s tag system, but you treat it as a category by adding something like “Category” as a label, right? That perspective never crossed my mind. Thank you for the great idea.

It’s unfortunate that we can’t use a URL like /category/. Since it’s still handled internally as a “tag,” I understand why it gets classified as a tag page.
Still, I never would have come up with this approach myself.

Thank you.

evaldas
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Hi @TMisuna,

 

Correct, HubSpot does not have a separate "category" feature - it only has the "tags", which also does not have a hierarchy feature.

 

There is a section in the UI for managing tags but there isn't an option to allow editing the slugs. 

 

https://app.hubspot.com/blog/{YOUR_PORTAL_ID}/manage/tags

 

Looking at the API docs, it also does not look like there is an option to set the slug for a tag:

https://developers.hubspot.com/docs/api-reference/cms-tags-v3/blog-tags/patch-cms-v3-blogs-tags-obje...

 

It might be something that is generated dynamically by the system based on the name of the tag.

✔️ Did this post help answer your query? Help the community by marking it as a solution.

TMisuna
Contributor

Thank you very much.
I understood it clearly, and I really appreciate your answer.