htmlsharelinkedin-apiquery-string

LinkedIn share button removing the QueryString from the URL


Trying to create a share to LinkedIn button which points to a page with querystring at the end.

  1. As you can see, the code contains the URL:

    • https://stackoverflow.com/users/8757883/akber-iqbal?tab=summary
  2. but upon going to the LinkedIn site, the URL becomes:

    • https://stackoverflow.com/users/8757883/akber-iqbal?tab
  3. the querystring part is removed, the question: Is there anyway to go around this issue?

a i {color:#000}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https://stackoverflow.com/users/8757883/akber-iqbal?tab=summary">
<i class="fa fa-linkedin-square" style="font-size:36px"></i>
</a>


Solution

  • Update 2020 : Linkedin has updated its sharing url , so query parameters not supported in URL

    https://www.linkedin.com/sharing/share-offsite/?url=URL_HERE
    

    OLD Answer :

    here is working demo :

    convert your = to %3D

    tab%3Dsummary

    here is link to encode your character .

    a i {color:#000}
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <a href="https://www.linkedin.com/shareArticle?mini=true&url=https://stackoverflow.com/users/8757883/akber-iqbal?tab%3Dsummary">
    <i class="fa fa-linkedin-square" style="font-size:36px"></i>
    </a>