Jump to content

Link Clean — Remove extraneous information from URLs

Recommended Posts


Remove UTM parameters, mobile subdomains, and other clutter from URLs via the Universal Action.


Alternatively, configure the Hotkey to clean a selected URL or use the lc keyword to declutter the last copied URL.


Redirects are followed before cleaning and the result is pasted to the frontmost app.

⤓ Install on the Alfred Gallery | Source


Edited by vitor
Link to comment
  • 3 weeks later...

When reporting issues, please include your exact installed versions of:

  • The Workflow.
  • Alfred.
  • macOS.

In addition to:

  • The debugger output. Perform the failing action, click “Copy” on the top right and paste it here.
  • Details on what you did, what happened, and what you expected to happen. A short video of the steps with the debugger open may help to find the problem faster.

Thank you. Accurate and thorough information is crucial for a proper diagnosis which allows me to help you better.

Link to comment
  • 2 months later...
  • 3 months later...
  • 1 month later...



Generalize to remove everything after ?. I used to only do that case-by-case since there are legitimate uses for ? that change the page without being useless, but it seems like that maybe the minority. Trying it this way and maybe will add exceptions instead. Please let me know if any links break with this new rule.

To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater.

Link to comment
  • 5 weeks later...
  • vitor changed the title to LinkClean — Remove extraneous information from URLs

I just installed it. On amazon.com works great, but on Amazon.de not so good, this is before and after (yes - they are the same):





Link to comment
  • 1 year later...



Added Universal Action, Hotkey, and External Trigger. Also, when getting a URL from the clipboard, it now gets the most recent one (text starting with http) from your clipboard history.

To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.

Link to comment
  • 11 months later...
  • 1 month later...

Hi @vitor, it seems like the workflow has trouble processing URLs with special characters. In the following example, the letter "ê":




[09:04:45.245] ERROR: LinkClean[Run Script] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:21:in `split': URI must be ascii only "https://www.amazon.com.br/Ame\u0302ndoa-Crua-Sem-Casca-Naturais/dp/B0B8K34Q6T/ref=sr_1_3?keywords=ame\u0302ndoas&qid=1683633872&sprefix=ame\u0302ndoas,aps,257&sr=8-3" (URI::InvalidURIError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:73:in `parse'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/common.rb:234:in `parse'
	from ~/Documents/Alfred Backup/Alfred.alfredpreferences/workflows/user.workflow.85C674D2-59BA-4C72-9F72-558B7E243773/linkclean_functions.rb:14:in `clean_url'
	from ~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/81F8F0A2-2B58-4E6A-A27F-C29BF057A1B6:3:in `<main>'


Link to comment
  • vitor changed the title to Link Clean — Remove extraneous information from URLs

Hi @vitor, getting an error on the following link:




[18:23:32.167] ERROR: Link Clean[Run Script] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:213:in `spawn': no implicit conversion of nil into String (TypeError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:213:in `popen_run'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:159:in `popen2'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:342:in `capture2'
	from ~/Documents/Alfred Backup/Alfred.alfredpreferences/workflows/user.workflow.85C674D2-59BA-4C72-9F72-558B7E243773/linkclean_functions.rb:7:in `follow_redirects'
	from ~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/24729476-AB52-40DA-B4D6-492C2ED02142:3:in `<main>'


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...