Long URL with Query String Highlighted

Tiny Tip – Fix Stupid Long Copied URLs

Have you ever copied a URL from a website to send to someone, and it turns out to be giant? Like 10 lines long giant? It’s embarrassing and is likely to turn off your recipient from clicking the link and seeing the funny TikTok video or buying you the gift you wanted.

There’s a very easy method to make the link still work and yet shorten it up quite a bit. I learned this method because of an episode of Programming by Stealth where Bart taught us how URLs work, and broke them down into their parts.

These long URLs are created so that the website receiving them can figure out how you got to their website or how you searched. For example, they might like to know what you searched for to arrive at their site in hopes of measuring the success of their search methods.

As an example, I went to Amazon and searched for women’s winter coats, and then selected one of the coats. The URL I copied after doing this search on Amazon is 430 characters long!

https://www.amazon.com/Uoiuxc-Womens-Winter-Puffer-Thicken/dp/B08CZ5T4LN/ref=sr\_1\_2\_sspa?crid=2YGF3TYYGP94G&keywords=winter+coats+for+women&qid=1639237073&sprefix=Winter+coat%2Caps%2C233&sr=8-2-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEzR0JMTU5PWEk2UktIJmVuY3J5cHRlZElkPUEwMTYwNzMyMlhBV0IxQkU2SkM2RCZlbmNyeXB0ZWRBZElkPUEwMjIxMTAwMkQ4VEZGTldYTUE3UyZ3aWRnZXROYW1lPXNwX2F0ZiZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU=

In these giant URLs, you’ll find a question mark (?). This question mark is the beginning of what is called the query string. After the question mark, you’ll see some text followed by an equal sign (=) and then some more text. The text before and after the equals sign is called a name/value pair. In my coat example, I can see “keywords= winter+coats+for+women”. You can see how this information would be valuable to Amazon. That wouldn’t be too stupid to have on the copied URL, but it goes well beyond that.

After the first query string, you may see an ampersand (&) and another name/value pair separated by equal signs. These can be readable like the example I just gave, or they might be a giant pile of glop text and numbers.

Here’s the useful part of what I just explained. The entire query string can be removed from the URL and it will still work to get to the same place on the web. Be sure to remove the question mark when you cut the query string off.

After removing the query string on the giant URL for the winter coat on Amazon, the URL drops down from 430 characters to only 92:

https://www.amazon.com/Uoiuxc-Womens-Winter-Puffer-Thicken/dp/B08CZ5T4LN/ref=sr\_1\_2\_sspa

Long URL with Query String Highlighted
Long URL with Query String Highlighted

It’s a little tricky to select the text of a URL without actually letting it navigate there but you’ll get the hang of it after a while. I would suggest testing your newly shortened URL before sending it just to make sure it still works.

I use this trick all the time and I think it increases the likelihood that my recipients will actually click my links. Hope you find it useful as well, and thanks to Bart for always teaching us something new.

2 thoughts on “Tiny Tip – Fix Stupid Long Copied URLs

  1. David - December 14, 2021

    Ah yes, I always do this, if for no other reason than politeness to the person/people I am sharing the link with. There is no reason that the tracker should track them.

  2. Donna - December 20, 2021

    EXCELLENT tip! Thanks Bart & Allison!!

Leave a Reply

Your email address will not be published.

Scroll to top