Any way to remove a URL parameter from the URL?

I’m looking to send a URL parameter to a page that will kick off a specific workflow and I’d like to remove this URL parameter as well (so the URL looks cleaner). The problem I’m running into is there are numerous other URL parameters that can exist on this page so using an action to navigate to the page might accidentally strip other URL parameters that are still needed.

Anyone know another approach to solve for this?

1 Like

You can build a workflow that uses Go To Page with every URL parameter copied from itself and just the one parameter you want empty blank:

image

It’s not super-sexy as you’ll have to update it for every parameter you add later, but it works.

2 Likes

Was just about to suggest the same thing! You could also just not include the parameter you’re lifting out as an alternative to leaving that particular one blank. (Re-send the rest, exclude the other one)

1 Like

Yeah, that was my initial thought but my concern is that I’ll break it further on down the road and not realize it. In fact, I’m pretty sure that’s the exact type of mistake I’d make, lol.

Yeah, it’s a little risky and easy to break. I’ve used customer workflows for it in the past, and placed them in their own workflow folder to remember to update them when necessary.

I also don’t want to add all of the other URL parameters (just the ones that are actively being used) and the logic for that is hairy because I’d have to create a workflow for every permutation.

Plus, we use URL parameters to pass data between reusable elements so it’s easy for me to add URL parameters to the page indirectly, and not think anything of it (but then break the logic).

You could also try a Regex pattern to extract it. You’d use “open external website” for “This URL” and “find and replace” the parameter key & value you want out with regex to replace with blank. I feel like that’s more complicated, but could be another way around it.

2 Likes

That’s smart! Think I may have to try something like that. Thanks Gaby!

1 Like

sorry. I know this is an old thread but can you provide more insight about this? I didn’t quite get it.

If it’s an empty URL parameter that you want to remove, there is a plugin for that. https://bubble.io/plugin/remove-empty-url-parameters-1558770956236x539499438875082750

6 Likes

Thank you so much. I’m building a page with multiple languages and EN_GB being the silent default, while other languages are carried with a URL parameter.
BUT when switching back to EN_GB appeared too, ruining my nice default URLs…

So now when EN is clicked and URL redirect is done with other necessary keys, I set the KEY lang = “”, and then use Action “Remove Empty URL Parameters”, and then do Page Refresh (I noticed it required that for the unset parameter to take effect).