Filter blog posts by tags

Hi guys!

When it comes to blogs in Hubspot. Since we can only have one listing page, I am wondering how can I create other pages where I can see different listings filtered by tags?

I have a blog menu with different topics, when I click on the menu item that says “Programming” for instance I would love to be able to go to a page where I can find all posts that had “programming” as their tag.

How can I do that?

Thank you!

Hi @AzharBondi HubSpot automatically creates dynamic pages for your tags, the layout is based on the listing page template so you don’t need to create any additional templates or modules.

Here’s an example of a blog listing page and when you click on the tags, it will generate the URL automatically to display the posts for the tag:

https://www.maka-agency.com/power-theme-blog-3-col/**tag**/compliance

Here’s more on coding the if tag for blog templates.

Thank you for your help Jennifer!

Hi again @Jnix284 ,

the filter worked perfectly using the URL syntax you provided. Now, I am wondering since I am using a menu, and for SEO purposes I would love to have not only the tag’s name (which happens to be the submenu item’s name as well) but also the menu item’s name on the URL.
So instead of my url looking like this : https://blog.randomexample.com/tag/difficult

I would love it to look something like this:
https://blog.randomexample.com/difficultylevels/difficult

or like this if the tag attribute can’t be omitted at all
https://blog.randomexample.com/difficultylevels/tag/difficult

Thank you,
Azhar

@AzharBondi this isn’t possible that I know of without an extensive workaround where you create new website pages with the URL you want and then redirect the tag URLs to those pages.

Hey @Jnix284 ! This Hubspot blog menu is what got me thinking how did they make it ?
https://blog.hubspot.com/service?hubs_content=blog.hubspot.com%2Fmarketing&hubs_content-cta=null&hubs_post-cta=blognavcard-service

How were they able to use the blog URL https://blog.hubspot.com/

in many pages that look like listing pages when we only can create one listing page and the other type of pages possible to create is posts pages! This is what is confusing me ! Am I missing something?

Hi @AzharBondi Happy to help clarify how the HubSpot blog is configured.

All of their blogs are on the subdomain blog.hubspot.com, but rather than one blog with tags for Service, Marketing, Sales, etc. they have created individual blogs for each of their “topics” and have tags within those individual blogs.

so the service blog is The HubSpot Customer Service Blog

You can certainly create multiple blogs to create a similar concept - I would recommend using company.com/blog/service rather than the subdomain (blog.company.com) unless you’re working with a brand that has significant authority like HubSpot - Google will treat each subdomain uniquely, so your blog traffic won’t help your website if they aren’t on the same subdomain.

I am dealing with a similar situation, but here’s what I’d like to do.

For example, when someone clicks on a tag, they go to “blog.url.com/tag/events”

I want to have a distinct photo and blurb at the top that then shows the rest of the normally generated tag-filtered blog posts.
And a different photo and blurb for the “charity” tag page, etc.
Where do I edit those per tag?

@drewspotshubs this is not currently possible in HubSpot. The Tag pages all use the blog listing template as the basis, same with Author pages.

If you want unique/custom pages for each tag, you would need to create a website page that is published to the blog.url.com and then use redirects for the tag URLs

For example, you could create blog.url.com/charity and then redirect /tag/charity to that page. You’d need to recreate the post preview functionality for each tag, once you do that, the options are limitless with how you can design the page.