Page 1 of 1

og:image image size

Posted: 15 Feb 2026, 12:28
by mvandamn
Hi,

I was wondering if there might be a improvement to the way the OpenGraph image tags are handled.

Recently I noticed that when sharing a page over Whatsapp, the preview image doesn't show. Some more digging revealed the image was to big.
That might be a rather lame limitation of WhatsApp, but on the other hand, its a preview, we don't need to full size.

Currently the `og:image` tag links to directly to the page preview image, which is full size.
But there is also the `/render/w1280` endpoint. Would it be possible to link to there instead?

I am not exactly sure what the most universal spec is for the OpenGraph image, but a quick search seems to suggest 1200x630px and < 600KB.
For my case it seems the w1280 comes close to fit that bill.

Any experts on the og tags are free to chime in. But I think we could improve this a little for the social media crowd :)

Re: og:image image size

Posted: 15 Feb 2026, 22:03
by mjau-mjau
Nothing you say is wrong, but ultimately we should share the original image at it's original size, because "og:image" can be used for many things. When you say "preview", I guess you are referring to the link preview that WhatsApp creates when you share a link ... It should really create it's own downsized version of the image for this scenario, just like all other services do. For example, when you share a link on Facebook, it will take the preview image full size (which likely remains in it's own cache), and spawns a resized version suited for the specific device, screen and sharing method.

It seems to be a WhatApp-specific issue that it doesn't want to download large images, and then resize them on it's server, likely because it considers it to be "too slow".
mvandamn wrote:Currently the `og:image` tag links to directly to the page preview image, which is full size.
But there is also the `/render/w1280` endpoint. Would it be possible to link to there instead?
Even if this would be a useful solution in your case, unfortunately, you can't modify this code, because it's built into templates that have been pre-rendered into PHP cache files.
mvandamn wrote:Recently I noticed that when sharing a page over Whatsapp, the preview image doesn't show. Some more digging revealed the image was to big.
Makes you wonder what their limit is? :thinking:
mvandamn wrote:That might be a rather lame limitation of WhatsApp, but on the other hand, its a preview, we don't need to full size.
Since we can't really provide multiple og:images, it should really be the service's responsibility to "get" the og image and then serve it at an appropriate size for the specific sharing scenario.

I think in most cases, when people upload web-size images, this shouldn't be a problem. However, if you are uploading camera-originals (5-10.000 px), this could be an issue on some platforms (eg WhatsApp).

The only workaround solution I can think of, is to upload a smaller images into the folder(s) you want to share, and set it/them as preview images.

Re: og:image image size

Posted: 16 Feb 2026, 06:04
by mvandamn
Thank you for your response.

I had not thought of other usecases for the Open Graph metadata outside of social media and messaging apps. So far it worked as expected for most use-cases, but always wondered why sharing on WhatsApp is a hit or miss situation.
mjau-mjau wrote:Makes you wonder what their limit is? :thinking:
After some digging, it used to be 300KB, and now seems to be 600KB in size.

I was able to confirm so using your suggested workaround. I've resized by preview image, uploaded it as a hidden `__preview.jpg` , and selected that as the cover for the folder. Now sharing works as expected in WhatsApp, while still keeping the full sized image in the album for the viewers.
mjau-mjau wrote:I think in most cases, when people upload web-size images, this shouldn't be a problem. However, if you are uploading camera-originals (5-10.000 px), this could be an issue on some platforms (eg WhatsApp).
I don't upload camera originals, but they are 2880px long edge, and do tend to float around 1-3MB in size. This does fall well within most specs you see for the `og:image` tag (usually up to 8MB is mentioned). But most sources seem to recommend the 1200px width for this image.
mjau-mjau wrote:Since we can't really provide multiple og:images
Technically we can: https://ogp.me/#array, and I have seen recommendations to serve a landscape and a square crop version. But I haven't tested this out.

I don't want to share to many links, as I can't certify the correctness of these recommendations, but these are some I came across: I can work with that workaround, but I'd be happy to test if any improvements come to mind with regards to the Open Graph metadata.

For reference, the link to the album with workaround in place: https://marcusvandam.nl/photography/rob_acda_awards/2026/voorronde-1/
Any other album is currently untouched.

Re: og:image image size

Posted: 16 Feb 2026, 21:29
by mjau-mjau
mvandamn wrote: I was able to confirm so using your suggested workaround.
Great!
mvandamn wrote:But most sources seem to recommend the 1200px width for this image.
True. I do however think it generally means "minimum" 1200px width, which allows the images to be applied for multiple scenarios, for all kinds of screens and devices. For example Facebook, who invented the OG scheme, it's entirely fine to serve massive images, especially when also providing width and height.
mvandamn wrote:Technically we can: https://ogp.me/#array, and I have seen recommendations to serve a landscape and a square crop version. But I haven't tested this out.
Yep, I think you are right, OG can probably server multiple image sizes. I may look into it, but it seems low priority considering it may only benefit WhatsApp.