Skip to content Skip to footer navigation
🏰 Statamic Summit 2027 Feb 16–19 Talks, workshops, and three nights in a German castle. Get Tickets

URL Encode Except Slashes Modifier

URL-encodes a string. Just like urlencode, but doesn't encode forward slashes (/).

string: please and thank you/Mommy
{{ string | urlencode_except_slashes }}
{!! Statamic::modify($string)->urlencode_except_slashes() !!}
please+and+thank+you/Mommy