GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.06k stars 407 forks source link

[Bug]: OG image not showing up in whatsapp #1230

Closed kmanadkat closed 11 months ago

kmanadkat commented 11 months ago

Operating system

mac os 13.4.1

Publii version

0.42.1

Post editor

Block editor

Bug description

I am facing problem with OG tags. I see preview image of my Post in Instagram & Twitter. In whatsapp however it shows only Text, no preview image. Please find examples before:

Twitter IMG_2869

Instagram IMG_2870

Whatsapp IMG_2868

After searching a bit I found that whatsapp ignores og:image url if og:image:width or og:image:height is more than 300.

I am not finding any option to set those tag values myself. I checked the blog theme source code too, it seems it is just populating value what is passed in handlebar variables by Publii.

Screenshot 2023-07-22 at 10 50 52 PM

Also, how do i remove this from all my site pages?

<meta name="generator" content="Publii Open-Source CMS for Static Site">

Thanks

Steps to reproduce

Paste this link in whatsapp messages: https://krupeshanadkat.com/running-mysql-and-phpmyadmin-with-docker/

Relevant log output

No response

dziudek commented 11 months ago

Hi,

It is not a problem with Publii, but with fact that your OG image is greater than 300kB - please optimize it and try again: https://stackoverflow.com/a/39182227

So you must to optimize your featured image to fix this.

kmanadkat commented 11 months ago

@dziudek By 300 i meant 300pixels not the file size. Practically no blog post header will be just 300px in size width or height. We just need to put value of 300px because behind the scenes Publii is already making images responsive.

Please allow us an option to edit these meta tags.

dziudek commented 11 months ago

@kmanadkat - did you read the linked post? it mentions 300kB not 300x300px - it would be ridicolous, because Facebook prefers 1200x630px for OG images, and it is not possible to serve multiple og:images AFAIK

kmanadkat commented 11 months ago

@dziudek oh sorry, my bad, I read your latest message and missed the above one. I will recheck the image size coming through og url. If its less than 300kb then I will reach again for help

Thanks 🤝

kmanadkat commented 11 months ago

@dziudek I decreased the image size ~264kb & it worked.