url_encode

Encode a string into percent-encoded URL format for safe transmission in web addresses.

Syntax

{{ string | url_encode }}

Example

{% assign address = "100 Main St, Austin TX" %}{{ address | url_encode }}

Output

100+Main+St%2C+Austin+TX

The url_encode filter converts spaces, punctuation marks, and non-ASCII characters into percent-encoded entities suitable for safe use in URL query strings and deep links.

In programmatic SEO architectures, url_encode constructs dynamic external links to map services, calendar booking widgets, or CRM pre-fill forms. For example: <a href="https://maps.google.com/?q={{ row.full_address | url_encode }}">Get Directions</a>. This prevents broken links when addresses contain commas or spaces.

Try this syntax in the editor.