Multi-Word Vendors Leading to 404 Collection Pages

Topic summary

A user encountered an issue where clickable vendor/brand names on product pages led to 404 errors when the vendor name contained multiple words. Single-word vendor names worked correctly.

Original Implementation:

  • Used handelize filter to format vendor names in collection URLs
  • Code: <a href="/collections/vendors?q={{ product.vendor | handelize }}">

Problem Identified:

  • The handelize filter converts spaces to dashes, but query parameters require URL encoding
  • Multi-word vendors (e.g., “Brand Name”) became “brand-name” instead of “Brand%20Name”

Solution:

  • Replace handelize with url_encode filter
  • Updated code: q={{ product.vendor | url_encode }}
  • This properly encodes spaces as %20 for URL query parameters

Outcome: Issue resolved successfully.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

Hi All!

I appreciate the help anyone can provide! I’m looking to make the Vendor/Brand name from product pages clickable and lead to auto-populated collections by vendor. I’m using this code:

{% if product.vendor %}

Brand: {{ product.vendor }}

{% endif %}

The problem is, for single-word vendors, it populates just fine, but if a vendor name is more than one word, it leads to a 404 page. I’m sure it’s just a small thing I’m missing, but any ideas there? Thanks again!

Hi @MontanaGC :waving_hand: Confirm if it’s a url encoding problem, try manually replacing the space, or dashes, with the space url encoding: %20.

The vendor value is being put into a query parameter so it needs to be url encoded not handelize as that inserts dashes and the vendor name does not have spaces in it.

https://shopify.github.io/liquid/filters/url_encode/ , e.g. q={{ product.vendor | url_encode }}

If you need this debugged further or theme customization then contact me for services
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

1 Like

This worked like a charm! Thanks, Paul!

1 Like