Image doesn’t appear in Open Graph preview

Issue: You are using SVG as your logo or post image

You’ll notice that your SVG image isn’t showing up when you share your post on Facebook, or an Open Graph checker/tester service. Bellow are some services to preview meta tags :

OG:image not rendered
OG:image isn’t rendered here

Since i’m using Rank Math plugin, in Title & Meta section, i went to Homepage tab and i set my site svg logo as the Homepage Thumbnail Preview for Facebook. This was my mistake and perhaps yours as well.

Problem is Open Graph does not support SVG images.

So if you’ll have a piece of code like this :

<meta property="og:image" content="http://site.xyz/logo.svg" />

Open Graph Object Debugger will not detect it as an image.

Solution: Use png or jpg images as your thumbnail

To solve this i exported my logo from my original .ai project as a png image

Png logo as thumbnail for homepage
Png logo as thumbnail for homepage

After save i went to test the preview of my site’s homepage on https://metatags.io/ .

homepage png preview by og protocol
Problem solved, now the image is accessible by the OG protocol

Issue: Open Graph doesn’t allow relative URLs

If you’ll have relative paths OG will say it’s not an image. Code example :

<meta property="og:image" content="images/logo.png" />

Solution: Use absolute URLS

Your code must look like this in order to be valid for the OG protocol :

<meta property="og:image" content="https://mustcode.xyz/images/logo.png" />

Leave a Reply