DEV Community

Cover image for How to add WhatsApp share button on a website ?
Sh Raj
Sh Raj

Posted on • Edited on

How to add WhatsApp share button on a website ?

Here are two methods which can be used to link a button. When user will click it. The user will be redirected to WhatsApp app on Android/PC. With the massage given in the parameter.


See Detailed Video :- https://youtu.be/CSXCxMzvu9A


<a href="https://api.whatsapp.com/send?text=urlencodedtext"></a>
Enter fullscreen mode Exit fullscreen mode

<a href="whatsapp://send?text=<<HERE GOES THE URL ENCODED TEXT YOU WANT TO SHARE>>" >Share via Whatsapp</a>

Enter fullscreen mode Exit fullscreen mode

<a href="https://wa.me/?text=urlencodedtext">Share this</a>
Enter fullscreen mode Exit fullscreen mode

As you seen in the example if you want to add line breaks to your massage or write massage as you send on WhatsApp. You have to use urlencodedtext.

You can Convert your Text into URL encoded text from here :- https://www.google.com/search?q=url+text+encoder

As you can See an Example Here :- https://createevminutes.sh20raj.repl.co/

Checkout Instagram :-


Top comments (0)