This can be quite frustrating, especially when you are trying to share a link with someone. To stop this annoyance, here are three userscripts that works on Google Chrome, Opera and Mozilla Firefox, with Greasemonkey add-on installed.
Install: Clean Facebook URL userscript
Google search URL
Install: Clean Google search URL userscript
Twitter replaces actual url with shortened t.co links, which it uses to check all links for spams. Shortened URLs are better for sharing, but if you’d rather like the original link then install below userscript to disable link shortening as well.
Install: Clean Twitter URL userscript
These are some recommended extensions for your favorite browser that improves browsing experience. Install them and open a new tab page for the effect to take place.