We can add whatsapp sharing button to our website just like facebook,twitter,g+ etc. and share the content to  whatsapp contacts or groups. This is tested in iphone and android version 2.3.6. We may require latest whatsapp installed on phone. Lets see an example:
 
<a href="whatsapp://send?text=http://webdevelopmentscripts.com">Share on whatsapp</a>
When you click on this link in mobile, if you installed whatsapp then it opens your whatsapp contact list for sharing from there you can share the content

This is tested from android version 2.3.6 and iphone, incase if it doesn't work then update latest version of whatsapp then give a try.

DEMO (Click below link if you visiting from mobile/tablet)

Click to share on whatsapp

UPDATE:Whatsapp share link with images 
Above article just shows plain url with text while sharing in whatsapp. If you want to show rich preview of the link in whatsapp, checkout this link:
Watsapp share link with images

 


Comments (17)
  1. Image
    Tal - Reply

    October 24, 2017

    Hello, I would like to embed the code that you mentioned, but I want to pull the current URL of my site. Can you tell me please how to do this?

    • Image
      WDS - Reply

      October 24, 2017

      You can assign current URL to any JavaScript variable and replace the URL mentioned in the example with that JavaScript variable. Ex: var current_url = document.URL;

  2. Image
    Manish - Reply

    June 12, 2017

    how to share in heading using whats up share .. ex. title in news

    • Image
      WDS - Reply

      June 20, 2017

      Follow this article: http://webdevelopmentscripts.com/80-whatsapp-share-link-with-image-in-websites

  3. Image
    Amy - Reply

    January 06, 2017

    How to add an image along with the text to be shared

    • Image
      WDS - Reply

      January 11, 2017

      You just need to add four meta tags to your web page to make it happen. Check out this link: http://webdevelopmentscripts.com/80-whatsapp-share-link-with-image-in-websites

  4. Image
    Amy - Reply

    January 06, 2017

    How to add an image along with the text to be shared

  5. Image
    Farhan - Reply

    December 27, 2016

    is there anyway to do this for a web application (not mobile website)

  6. Image
    Pradeep - Reply

    November 25, 2016

    is it possible to share a image from website uploaded with any file name? how?

  7. Image
    Xy - Reply

    November 16, 2016

    How to make it unable to click if is using pc but able to click if is using mobile?

    • Image
      WDS - Reply

      November 18, 2016

      Instead making it unclickable, you can hide it by default and show only in the mobile, tablet kind of devices by using CSS media queries

  8. Image
    Gaurav Sable - Reply

    October 31, 2016

    HOW WE CAN DO THIS WITH A WHATAPP IMAGE LIKE, WE UPLOAD A IMAGE SAYING "SHARE ON WHATAPP" AND BY CLICKING IT WE SHARE IT

    • Image
      WDS - Reply

      November 01, 2016

      Just put the image tag inside the anchor tag, so by clicking the image trigger the watsapp sharing...

  9. Image
    Aditya - Reply

    July 14, 2016

    worked like a charm! thanks!

Leave a Comment

loader Posting your comment...