share image content and url on whatsapp from web site without og tag

Sachin Sudhakar Sonawane picture Sachin Sudhakar Sonawane · Jun 12, 2017 · Viewed 8.4k times · Source

WhatsApp share a link, content and image this can be done by using og tags i.e. open graph tags

<meta property="og:title" content="title" />
<meta property="og:description" content="Description for image" />
<meta property="og:url" content="https://myurl.com" />
<meta property="og:image" content="https://myurl.com/imagepth" />

But this has limitation, we can share only one image

I want something as like of facebook sharer link which can share image content url

https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmyurl.com%2F

I am having multiple links with images content on one page I want set option for each block to be share on WhatsApp as like of facebook sharer

Using og tag we can share single image content from one page

enter image description here

but I need separate link for each block to be share as shown share button on reference image above

Answer

Ulrich Thomas Gabor picture Ulrich Thomas Gabor · Jun 21, 2017

One possible solution is to have separate "share" pages for each shareable entity. Each page can contain the og tags (especially an image) for the single box/button which links there.

Since the shared URL may then look like example.org/shared.php?id=1 it is also the URL the user will access if they click on the shared block on facebook/whatsapp. You have two possibilities to deal with this situation:

  1. Provide a "detail" page for every of your shareable entities, but I guess there are no detail pages in your current setup and based on the size of your boxes you may not want them.
  2. Redirect to your "list" page, if the useragent is nothing related to whatsapp/facebook. This case whatsapp/facebook "sees" the HTML containing the og tags and when real users enter the page they are redirected to the list page.