Showing Thumbnail for link in WhatsApp || og:image meta-tag doesn't work
Asked Answered
G

28

146

Tried to follow this question : Provide an image for WhatsApp link sharing

enter image description here

I have created a simple HTML webpage with the basic Facebook metatags:

<!--FACEBOOK-->
<meta property="og:title" content="San Roque 2014 Pollos" />
<meta property="og:description" content="Programa de fiestas" />
<meta property="og:image" content="http://pollosweb.wesped.es/programa_pollos/play.png" />        

The Facebook linter validate correctly and in Facebook it shows perfect, but when I try to share by WhatsApp the image doesn't show.

I'm trying it on WhatsApp on Android

This is the URL of the Sample Webpage

Glover answered 3/8, 2014 at 1:56 Comment(6)
Strange... the og:image should be enough. I tried to share a youtube link and i can see correctly the thumbnail in my chat. I tried to see if Youtube was using more meta tags without discovering anything special.... are we facing a cache problem?Velasco
excuse me , but are you sure this is even possible ? have you seen it else where before ? do you have some link that have a thumb on whatsapp ?Kandacekandahar
it's possible to increase picture height and width???? in WhatsappGooch
I used same tag its not working please guide #47237239Reprehend
Can I reference an Image without any HTTP call, as in content="./images/logo.png"?Spoil
I add this here as it's a helpfull information... If the image being using as thumbnail it's on a https server that does an 301 redirecte from a no https incoming request and on og:image:url it's put the not https url, the Whatsapp client would not follow the 301 redirectMcgann
T
172

I belive you need to add itemprop to the og:image meta tag, have the image size set to 256x256 and also it would not harm to add the site_name, type and updated_time properties either :)

<meta property="og:site_name" content="San Roque 2014 Pollos">
<meta property="og:title" content="San Roque 2014 Pollos" />
<meta property="og:description" content="Programa de fiestas" />
<meta property="og:image" itemprop="image" content="http://pollosweb.wesped.es/programa_pollos/play.png">
<meta property="og:type" content="website" />
<meta property="og:updated_time" content="1440432930" />

You can see these meta tags in action on for example Google Maps.
After you have changed your meta tags, you might need to wait a while for possible caches to update.

You can debug/verify Open Graph meta tags from the Facebook's Sharing Debugger
If you can see all your tags there, then the sites/apps where your tags are not showing properly might have different requirements for Open Graph tags.

EDIT:
If you are going to specify an image by a HTTP-Secure link, you need to use og:image:secure_url instead of og:image.

EDIT2:
You also need to specify og:type as it is one of the four base required parameters.
<meta property="og:type" content="website" /> should get you in the right direction.

Trouveur answered 22/8, 2015 at 9:58 Comment(17)
That could be because the image is unavailable in your first of the two meta tags with itemprop="image". Error message: Cannot GET /logos/logo_512.pngTrouveur
Also, if you are going to use secure-http links to image you need to use property="og:image:secure_url" instead of property="og:image"Trouveur
Thank you for your time. I made the changes. But still no luck. :(Fjord
The youtube link goes to a video where they show how to create a flat icon in Illustrator?Trouveur
Sorry for the ambiguity. When we send this link through WhatsApp, a thumbnail of the Video appear near the message as shown in this questionFjord
So if that links works, then look at the meta tags youtube is using. If it still doesnt work, maybe whatsapp has a "whitelist" on which sites to allow these kind of tags ? Because if you are using tags correctly and it is no question about server cache, then this issue is on server side.Trouveur
It worked perfectly! If Facebook error for app_id use this: <meta property="fb:app_id" content="xxxxxxxxxxxxxxx" /> Replace the xxxxxxxxxxxxxxx with the default id you receive from FB. Also it is important to add: <meta property="og:url" content="http://yoousite.com" />Capet
Some of your meta tags have a "/" at the end. Yay or Nay?Salientian
FB debugger: 100% ok. Rich Preview: 100% ok (Watsapp included). When I try to share by WhatsApp the image doesn't show. The url in my case is robotiqu.es ...no response a year later?Summersault
It's not working for me..any one have other solution ?Hopeless
Since facebook = whatsapp, another solution could be having a minimum image size of 200px (as per FB specs). Silly because whatsapp uses tiny thumbs so such are 'large' size is unnecessaryAlkyl
The Image size was the ultimate constraint... basically it has 100% the same guidelines as Facebook, but with stricter policy. Sure, facebook has the guidelines, but they are not that strict when it comes to image attachment when sharing a link. in case of Whatsapp, i guess it's safe to say u need it to be a square, minimum 200x200px - and if PNG fails, use JPG. hope this helps othersGrimes
Note that It may not work if your site runs on https with self signed certificate. Verified on Facebook and whatsappTaxaceous
This was my solution: Use the facebook open graph debugger. Find the problems in your open graph syntax. It worked for me. There were problems I would not have found without this tool. Made a few changes and poof! got the thumbnail in Whatsapp.Laith
not working in my case dev.dubairent.com/property/…Ratiocination
You always can add the version parameter for try without cache. In the URL just add this query parameter ?v=2. You also can use the timestamp programmatically.Embolic
If you site is fully HTTPS there is no need to use og:image:secure_urlEpa
K
62

I had the same issue and the problem was the size of the picture. Whatsapp doesn't support picture with a size greater than 300KB.

So the most important property to display image on Whatsapp is:

<meta property="og:image" content="url_image">

And the size of the image to display must be less than 300KB

Knead answered 27/8, 2016 at 14:29 Comment(2)
dev.dubairent.com/property/… not working in my caseRatiocination
Can confirm. After resizing the image to be square and about 100 kB in size the thumbnail appeared in WhatsApp (before it was 1920x1080 and 350 kB). I had to restart the WhatsApp in my Android phone. I did not need to add oldschool itemprop="image" nor og:image:secure_url attributes.Jade
O
33

After spending months trying to figure this out, I finally solved the issue. Here is my solution:

<!-- MS, fb & Whatsapp -->

<!-- MS Tile - for Microsoft apps-->
<meta name="msapplication-TileImage" content="http://www.example.com/image01.jpg">    

<!-- fb & Whatsapp -->

<!-- Site Name, Title, and Description to be displayed -->
<meta property="og:site_name" content="The Rock Photo Studio">
<meta property="og:title" content="The Rock Photo Studio in Florida">
<meta property="og:description" content="The best photo studio for your events">

<!-- Image to display -->
<!-- Replace   «example.com/image01.jpg» with your own -->
<meta property="og:image" content="http://www.example.com/image01.jpg">

<!-- No need to change anything here -->
<meta property="og:type" content="website" />
<meta property="og:image:type" content="image/jpeg">

<!-- Size of image. Any size up to 300. Anything above 300px will not work in WhatsApp -->
<meta property="og:image:width" content="300">
<meta property="og:image:height" content="300">

<!-- Website to visit when clicked in fb or WhatsApp-->
<meta property="og:url" content="http://www.example.com">

Copy the above, paste in head area of website. CLOSE your Whatsapp app, re-open, THEN test. No need to clear cache, and NO NEED TO CLEAR DATA.

Blessings to all!

Origami answered 1/5, 2019 at 3:55 Comment(2)
For me the filesize was responsible at all. As long as the files size is below 300 Kb everything is fine. I don't need measure properties. The og:image tag is enough.Equal
none worked in my case dev.dubairent.com/property/…Ratiocination
W
14

I found the solution here Whatsapp preview link posted on 2 March 16

And you should see working

Before and after screenshoot

enter image description here

There is two kind of code. First meta og:image inside <head>

<meta property="og:image" content="url_image">

Thumbnail schema from schema.org inside <body>

<link itemprop="thumbnailUrl" href="url_image"> 
<span itemprop="thumbnail" itemscope itemtype="http://schema.org/ImageObject"> 
  <link itemprop="url" href="url_image"> 
</span>

Hope this help. Thanks.

Wall answered 3/3, 2016 at 23:49 Comment(5)
FB debugger: 100% ok. Rich Preview: 100% ok (Watsapp included). When I try to share by WhatsApp the image doesn't show. The url in my case is robotiqu.es ...no response a year later?Summersault
@Wall How to pass this HTML content via Android IntentReo
does not work in my case dev.dubairent.com/property/…Ratiocination
@JitendraPancholi Now i saw ur link works. May I know how u solve it?Unknit
@Unknit In my case, I had applied the html compression which was removing all closing tags i.e. </html>, </body>, </div> etc. As soon as I added all closing tags, it fixed.Ratiocination
S
12

I also face that problem Finally, i solved it

<meta property="og:image" itemprop="image" content="http://yourdomain.com/yourfolder/imagename.png" />

My image property

  1. Dimension : 300X200
  2. Size : < 300KB
  3. URL: http://yourdomain.com/yourfolder/imagename.png

Make sure in image name there is no space, if you have two words then use underscore sign

Strict answered 25/8, 2017 at 22:34 Comment(1)
not working in my case dev.dubairent.com/property/…Ratiocination
V
5

I don't know about the minimum number of meta tags required to work on whatsapp, found this in somewhere and this worked for me flawlessly. Note: Image resolution is 256 x 256.

   <head>
    <meta property="og:site_name" content="sitename" />
    <meta property="og:title" content="title">
    <meta property="og:description" content="description">
    <meta property="og:image" itemprop="image" content="http://www.yoursite.com/yourimage.jpg">
    <link itemprop="thumbnailUrl" href="http://www.yoursite.com/yourimage.jpg"> 
    <meta property="og:image:type" content="image/jpeg">
    <meta property="og:updated_time" content="updatedtime">
    <meta property="og:locale" content="en_GB" />
    </head>

    <body>
    <span itemprop="image" itemscope itemtype="image/jpeg"> 
      <link itemprop="url" href="http://www.yoursite.com/yourimage.jpg"> 
    </span>

    </body>
Verwoerd answered 18/11, 2017 at 23:15 Comment(0)
T
5

Took 1 day but figure out what's needed. Following checklist might help you

it's fine if you don't include og:image:width and og:image:height meta tags. Following is my code which works. Use Facebook Debugger to find errors

<meta property="og:url" content="https://stgwww.moneycontrol.com/us-markets/" />
<meta property="og:type" content="website" />
<meta property="og:title" content="YOUR_TITLE" />
<meta property="og:description" content="YOUR DESCRIPTION" />
<meta property="og:image" content="https://stgwww.moneycontrol.com/react-asset/images/moneycontrol-us-markets.png" />
<meta property="og:image:type" content="image/png" />
  1. Image should be less than 200kb in size
  2. Width of the image should be 600px maximum, it's fine if height is less than 600px but maximum it should be 600px
  3. If your website is https make sure your image url should also have https
  4. Make sure page url is equal to what you are passing in og:url. In my case page url was https://stgwww.moneycontrol.com/us-markets/ but my og:url was <meta property="og:url" content="https://stgwww.moneycontrol.com/markets/us-markets/" />
  5. og:image domain should match with your website's domain, you cannot use image link of another website.
  6. use full path, relative path won't work.
//correct
<meta property="og:image" content="https://stgwww.moneycontrol.com/react-asset/images/moneycontrol-us-markets.png" />

//wrong
<meta property="og:image" content="//images/moneycontrol-us-markets.png" />
Tenderize answered 20/9, 2022 at 9:54 Comment(1)
200 kB, not 200 kbSopher
I
4

Clear your whatsapp data and cache (or use another whatsapp) !

Android Phone : Go to SETTINGS > APPS > Application List > WhatsApp > Storage and Clear Data.

Be careful ! Backup your messages before this action.

clear whatsapp data and cache

Then the result : before and after clearing data and cache WhatsApp before and after sharing

Inflexible answered 15/4, 2018 at 16:45 Comment(3)
this and making the file size less than 300kb worked for meGoethe
Only clearing cache is enough. No need to clear data.Bicorn
You can just cache bust the link instead: https://link.com/?_=92375293579Digitalin
F
4

Additional useful info:

You can provide several og:images, whatsapp will use the last one. This will help with the problem that e.g. facebook want 1.91:1 ratio and whatsapp 1:1

https://mcmap.net/q/92983/-provide-an-image-for-whatsapp-link-sharing

Fast answered 7/4, 2020 at 11:32 Comment(0)
S
3

enter image description here Had the same issue , I finally got it working after some trying. Here are the 8 html tags that I used on my web page to get the preview working :

In <head> tag:

<meta property="og:title" content="ABC Blabla 2020 Friday" />
<meta property="og:url" content="https://bla123.neocities.org/mp/friday.html" />
<meta property="og:description" content="Photo Album">
<meta property="og:image" itemprop="image" content="https://bla123.neocities.org/mp/images/thumbs/IMG_327.JPG"/>
<meta property="og:type" content="article" />
<meta property="og:locale" content="en_GB" />

In <body> tag:

<link itemprop="thumbnailUrl" href="https://bla123.neocities.org/mp/images/thumbs/IMG_327.JPG">

<span itemprop="thumbnail" itemscope itemtype="http://schema.org/ImageObject">
<link itemprop="url" href="https://bla123.neocities.org/mp/images/thumbs/IMG_327.JPG">
</span>

These 8 tags ( 6 in head , 2 in body) worked perfectly.

Tips:

1.Use the exact image location URL instead of directory format i.e. don't use images/OG_thumb.jpg

2.Case sensitive file extension: If the image extension name on your hosting provider is ".JPG" then do not use ".jpg" or ".jpeg' . I observed that based on hosting provider and browser combination error may or may not occur, so to be safe its easier to just match the case of file extension.

3.After doing above steps if the thumbnail preview is still not showing up in WhatsApp message then:

a. Force stop the mobile app ( I tried in Android) and try again

b.Use online tool to preview the OG tag eg I used : https://searchenginereports.net/open-graph-checker

c. In mobile browser paste direct link to the OG thumb and refresh the browser 4-5 times . eg https://bla123neocities.org/nmp/images/thumbs/IMG_327.JPG

Stuart answered 30/10, 2020 at 3:2 Comment(0)
S
2

For all still having this problem and as for me none of the posted solutions worked out.

I've had the similar issue. The image was showing correctly in all other share dialogs. Only WhatsApp couldnt display the image, even though the facebook debugger has the og:image tag correctly.

The solution that worked for me: I am using firebase. For uploaded content in their storage, you get a unique Download URL with a media token. Something like:

https://firebasestorage.googleapis.com/v0/b/XXXX.XXXXXXX.com/?alt=media&token=YYYYYYYY-YYYYYYYYYY-YYYYYYYYYYYYY

I used this URL in the og:image meta tag. It worked for Facebook etc., but it seems like WhatsApp couldnt download the image from this URL. Instead you need to include the image in your project directory and use this link for the og:image tag. Now it works properly in WhatsApp too.

Before (not working in WhatsApp, but facebook etc.)

<meta property="og:image" itemprop="image" content="https://firebasestorage.googleapis.com/v0/b/XXXX.XXXXXXX.com/your_image?alt=media&token=YYYYYYYY-YYYYYYYYYY-YYYYYYYYYYYYY">

After (now working in all shared dialogs tested, including WhatsApp)

<meta property="og:image" itemprop="image" content="https://domain_name/path_to_image">

Hope it might help some of you :)

Schear answered 9/11, 2016 at 10:2 Comment(2)
Can you please elaborate further ? What really is the difference ? Did you sort of rewrite the url of the image or what did you do ?Milliary
Probably that the domain must match the link being shared.Deflate
F
2

I documented the perfect detailed solution here - https://amprandom.blogspot.com/2016/12/blogger-whatsapp-rich-link-preview.html There are seven steps to be done to get the perfect preview.

  1. Title : Add Keyword rich title to your webpage with maximum of 65 characters.

  2. Meta Description : Describe your web page in a maximum of 155 characters.

  3. og:title : Maximum 35 characters.

  4. og:url : Full link to your webpage address.

  5. og:description : Maximum 65 characters.

  6. og:image : Image(JPG or PNG) of size less than 300KB and minimum dimension of 300 x 200 pixel is advised.

  7. favicon : A small icon of dimensions 32 x 32 pixels.

In the above page, you have the required specifications, the character limit and sample tags. Do upvote once you find it satisfactory.

Fokos answered 26/12, 2016 at 15:22 Comment(2)
Do explain what your link is doing... Links can disappear.Stormy
Is your source just from testing or are any of those requirements documented anywhere?Wulfila
C
2

If after all these tips, the thumbnail is still not showing, try this:

My problem was that the double quotes from the og attributes were being removed when built for production (npm run build). The Minify module was doing that.

So the solution was to cancel this removal, setting the removeAttributeQuotes attribute to false:

minify: {
    ...
    removeAttributeQuotes: false,
    ...
}

In my development environment, I set it on the "webpack.prod.conf.js" file. Set it at your equivalent file.

Just rebuild and it's now working.

Carnify answered 27/6, 2020 at 5:49 Comment(0)
K
2

Not sure it's WhatsApp issue or what, but pasting the link without "/" at the end works for me.

Example :-

https://example.com - WORK
https://example.com/ - THUMBNAIL NOT WORKING

Kellsie answered 23/8, 2021 at 18:11 Comment(0)
C
2

Please check if the file format of your thumnail work for whatsapp

In my case the rest of chat app like Messenger or Telegram are working fine with a GIF thumnail, but whatsapp does not so I have to change my image url

   <meta property="og:image" content="https://i.imgur.com/3lwkZdD.png" />
   <meta property="og:image:type" content="image/png" />
Canker answered 18/4, 2023 at 3:21 Comment(0)
C
1

In reply to https://mcmap.net/q/94154/-showing-thumbnail-for-link-in-whatsapp-og-image-meta-tag-doesn-39-t-work

Try the updated version for schema.org

<span itemprop="image" itemscope itemtype="http://schema.org/ImageObject"> 
 <link itemprop="url" href="imgurlHere">
 <meta itemprop="width" content="1200">
 <meta itemprop="height" content="800">
</span>

or using the json-ld format from google

<script type="application/ld+json">
 {
"@context": "http://schema.org/",
"@type": "ImageObject",
 "url": "ImgURLhere",
    "height": 800,
    "width": 1200

 }
 </script>
Cingulum answered 29/8, 2016 at 10:33 Comment(1)
Can you please add some explenation to your answer? Simply showing code can be confusing for some people.Rhombohedral
C
1

I hope this help:

<meta property="og:title" content="Title goes here">
<meta property="og:site_name" content="Site name">
<meta property="og:image" content="imageURLShouldBeFromSameDomainName">
<meta property="og:image:width" content="640">
<meta property="og:image:height" content="300">

Take note of the imgURL that should be hosted from same domain, or it will not show up on whatsapp. I tried loading a url from amazon, image preview is not working.

Cingulum answered 26/1, 2017 at 5:21 Comment(2)
How will you send this data via IntentReo
This question is entirely offtopicAccountant
E
1

In my case, adding the below meta tag solved the problem. I was using Arabic content and had to add this to make the image appear on WhatsApp:

<meta property='og:locale' content='ar_AR' />

Note: If you are using English content, no need to add this meta tag since English is the default value.

Ellita answered 12/4, 2019 at 9:31 Comment(0)
G
1

For anyone still experiencing this, I found that images served on Amazon S3 do not work for WhatsApp mobile app (both Android and iOS, but Mac desktop app was fine). It's very possible that our AWS settings cause this, but I noticed the pattern in other sites as well (e.g. this one with an og:image hitting a domain like https://s3.amazonaws.com).

There were no problems on any other platform I tried, just WhatsApp mobile apps. As soon as I pointed my <meta property="og:image" content="https://some-non-aws-location" /> to another public URL like a Google Drive file (shared publicly of course), it worked fine.

I also tried committing the image in our repo, which is hosted and deployed on AWS with a custom domain, and that didn't work either. So AWS still seems to be the culprit. Hope this helps someone!

Garlan answered 18/4, 2020 at 21:25 Comment(0)
B
1

November 2020 : As I experienced , these meta tags are required and effect on what you see on shared link in Whatsapp and WhatsApp-thumbnail :

<head>
 <meta content='myTitle' property='og:title'/>
  <meta content="myDescription" property="og:Description"/>
  <meta property="og:type" content= "website" />
  <meta property="og:image" itemprop="image primaryImageOfPage" content="https://i.ibb.co/1GRpwND/600px-Approve-icon-svg.png" />
</head>

and inside <body> :

<a href="https://wa.me/?text=https://myaddress.blogspot.com/2020/11/try-16.html" target="_blank" rel="nofollow">Hello whatsApp</a>

More explanation :

1- Suppose you have <meta content='example.com/page1' property='og:url'/> and inside body you refer to <a href="https://wa.me/?text=example.com/page2" >Hello whatsApp</a>, the og:image and og:description of page example.com/page2 wil be rendered on whatsApp as you referred on your link in body (maybe obvious).

2-When you add/change any open graph tags such as og:description, and again you click your <a></a> tag on your page/body, what you see on WhatsApp doesn't change unless you change the href="I am a new URL" of your <a></a> tag or clear cache of WhatsApp !!

3-I tried Png/jpg images, all less than 300 kb in size and all bigger than 300*300 in pixels, and image content was a https or a http url, the above code supports both of them ( No need to og:image:secure_url).

4-Each time you add/change og contents, to have a thumbnail on WhatsApp, the changes doesn't affect on first try !! and successful on second try. Very strange !

Bilharziasis answered 8/11, 2020 at 21:23 Comment(0)
T
0

Open Graph data:

<meta property="og:title" content="Title of your website | website.com"/>
<meta property="og:type" content="Most popular business directory of Bangladesh"/>
<meta property="og:url" content="http://www.website.com/"/>
<meta property="og:image" content="http://www.moumaachi.com/images/dhaka-city.jpg"/>
<meta property="og:site_name" content="@website"/>
<meta property="fb:admins" content="Author"/>
<meta property="og:description" content="website.com is your online business directory of Country"/>
Torbert answered 17/1, 2019 at 10:9 Comment(1)
not working in my case dev.dubairent.com/property/…Ratiocination
L
0

Only these 3 tags seem to be required (og:title, twitter:description, rel="icon"):

<meta property="og:title" content="San Roque 2014 Pollos" />

<meta name="twitter:description" property="og:description" itemprop="description" content="Programa de fiestas" />

<link rel="icon" type="image/png" href="https://images.weserv.nl/?url=http://pollosweb.wesped.es/programa_pollos/play.png&w=192&height=192" sizes="192x192" />

Experimenting / playing

The easiest way to experiment for me was with CodeSandbox following these steps:

  • Create a Vanilla app with https://codesandbox.io/s/
  • Modify your meta tags accordingly in the index.html file
  • Save the file (ctrl+s) which would fork the app and generate its own unique url
  • Paste that url in WhatsApp to see the preview (you don't even need to send a message)
  • Make changes to the meta tags
  • Modify the url - add a single character at the end of the url. This discards the "previous cached preview"

Quotes required

Just be sure to ALWAYS have quotes and closing quotes because WhatsApp is sensitive to that. Your above example does not have a closing quote for your og:description.

Legge answered 13/8, 2019 at 3:9 Comment(4)
not working in my case dev.dubairent.com/property/…Ratiocination
@JitendraPancholi, your (dubairent.com) website is not the same. Double-quote characters are required around attribute values. Here is the one from your website: <meta property=og:title content="Immaculate 4 Bed Townhouse Victory">. It should be: <meta property="og:title" content="Immaculate 4 Bed Townhouse Victory">. If you use Webpack with the HTML plugin, consider setting minify.removeAttributeQuotes to falseLegge
I corrected that now but whatsapp is still not showing image in preview, although title and description are showing as they were showing earlier too.Ratiocination
@JitendraPancholi, you can use the above instructions for "The easiest way to experiment for me was with CodeSandbox following these steps". Just copy your <head> section into the vanilla app. To get your website's raw html use the "view page source" option (in Chrome it is CTRL + U).Legge
B
0

I followed all the instructions in the anwers here, and I still couldn't get it to work. It seems WhatsApp also requires the extension for it to display the image.

So for a tag pointing to a jpeg:

<meta property="og:image" itemprop="image" content="https://example.com/someimageid"/>

Change the API to allow the extension and use:

<meta property="og:image" itemprop="image" content="https://example.com/someimageid.jpeg"/>

and it then seems to work...

Bartholomeo answered 20/9, 2020 at 9:40 Comment(0)
C
0

I was facing all kind of issues untill I manage to solve this problem, what helped me debug correctly are 1 https://developers.facebook.com/tools/debug/?q= MY URL 2 when pasting my url to whatsapp I add param to force whatsapp clear the cach myUrl?x=123 myUrl?x=1234 ...

Caniff answered 23/1, 2023 at 20:8 Comment(0)
E
0

Update 2023:

  • If you are using "title" and "description" in your application, then Whatsapp will take the Title and Description as "og:title" and "og:description".
  • so, consider updating it as well with "og:title" and "og:description" meta tags.
    this.meta.addTag({ property: 'og:title', content: "Your Title" });
    this.meta.updateTag({ property: 'title', "Your Title" });
    this.title.setTitle("Your Title");
    this.meta.addTag({ property: 'og:site_name', content: "Your Title" });
    this.meta.addTag({ property: 'og:description', content: "Your Description" });
    this.meta.updateTag({ property: 'description', content: "Your Description" });
    this.meta.updateTag({ property: 'og:image', content: "direct/path/to/image" });

Keep in mind that, we should have these meta tags when we are updating it. so we used "updateTag". If you are using Twitter Tags then It may also replace the whatsapp "og:image" so consider replacing them.

Edik answered 26/7, 2023 at 12:47 Comment(0)
I
0

I have tried the couple of options and below code works for me.

<meta property="og:site_name" content="yourdomainname.com">
<meta property="og:title" content="Any Title As Per Your Wish">
<meta property="og:description"
    content="Explore various technologies and resources. Learn them and build your career">
<meta property="og:image" itemprop="image"
 content="https://yourdomainname.com/static/blog/images/whatsapp.png">
<meta property="og:url" content="https://www.yourdomainname.com">
<meta property="og:image:width" content="300">
<meta property="og:image:height" content="300">
<meta property="og:type" content="website" />
<meta property="og:image:type" content="image/png">

Also, as suggested by @Azodium, sometime you may face issue due to WhatsApp data and cache while getting the expected result. So you might need to clear cache (To clear WhatsApp data and clear please follow @Azodium solution mentioned above), or you can simply use another WhatsApp number to share the website by typing your website URL. Also, make sure to use complete path of image property="og:image" instead of relative path and property="og:image:type" use the correct image type i.e png, jpeg, jpg as per your image type

Ie answered 24/1 at 0:56 Comment(0)
N
-3

You only need to type the message with "http://" at the start. For example: http://www.google.com shows the thumbnail image, but www.google.com no.

Neptune answered 28/7, 2016 at 13:16 Comment(1)
this should be a comment pleaseExcursion
D
-3

This Solution works for me:

    <meta property="og:title" content="Testing Title" />
    <meta
      property="og:description"
      content="This is best way to view your Time Table & Join Meetings"
    />
    <meta
      property="og:image"
      itemprop="image"
      content="//upload.wikimedia.org/wikipedia/commons/d/d4/JPEG_example_image_decompressed.jpg"
    />
    <meta property="og:url" content="https://google.com/" />
    <meta property="og:type" content="website" />
    <meta property="og:image:type" content="image/jpeg" />

tested on codesandbox.io

here's the link: https://l8ogr.csb.app/

one silly little thing did that magic, by removing "http" or "https" from the Image Url

if your image URL is ex: https://test.com/img.jpeg to //test.com/img.jpeg

<meta property="og:image" itemprop="image" content="//test.com/img.jpg"/>
Domineering answered 9/9, 2020 at 12:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.