How to update Open Graph URLs (og:image, og:url) to use absolute HTTPS URLs?
og-image-not-https page
The issue
A page whose og:image is a relative or HTTP URL can be shared without its image. The card loses its largest element, in exactly the places the page was meant to look its best, and nothing on the page itself shows it.
The cause is that the platform fetches the image from somewhere else. A relative URL such as /img/card.png has no domain to fetch from, and apps that require HTTPS won’t load an http:// image. The same goes for og:url, which platforms read as the page’s address and which needs to be absolute too.
Scope
Each page is checked on its own, once it declares at least one og: property. The image URL usually comes from a shared template, so one fix often covers every page built from it.
How to check you have it
- In probeo: the page reports
og:image must use HTTPS for Slack, WhatsApp, and Teams unfurls, as an error. Any value that doesn’t start withhttps://, relative ones included, gets it. Probeo checksog:urlfor presence, not for HTTPS. - By hand: view the page source and read the
contentofog:imageandog:url. Both should start withhttps://. Then open theog:imageURL in a browser to confirm it loads. - With a tool: Facebook’s Sharing Debugger shows the image it fetched, or the error it got.
The fix
Write og:image and og:url as absolute HTTPS URLs.
An absolute URL includes the scheme, the domain and the full path, such as https://example.com/img/card.png. Generate it in the template from the site’s base URL, so it can’t drift back to a relative path. Set og:url to the page’s canonical HTTPS address.
Done when: both values are absolute HTTPS URLs, the image loads when opened directly, and the check above comes back clean.
Do not
- Do not use a relative URL in an Open Graph property.
- Do not use an
http://URL forog:imageorog:url. - Do not use a protocol-relative URL such as
//example.com/card.png. - Do not point
og:imageat a file behind authentication.
FAQ
Can og:image use a protocol-relative URL like //example.com/image.jpg?
No. It doesn’t start with https://, so probeo reports it, and a platform reading it outside a page has no scheme to resolve it against. Write https:// in full.
What happens if the og:image URL is correct but the image file is blocked by robots.txt?
It may not load. Platforms fetch the image with their own crawlers, and a crawler that honors robots.txt won’t fetch a disallowed path. Keep share images in a path crawlers are allowed to read.
Should og:image use a CDN URL or the origin server URL?
Either works, as long as it is absolute, on HTTPS and publicly reachable. A CDN is usually faster for the crawler and for anyone viewing the card.
What dimensions should the og:image file use?
Facebook recommends at least 1200 × 630 pixels. Declare the size with og:image:width and og:image:height, which Facebook uses to show the image without first downloading it. Probeo warns when either is missing.
Does og:url need to include www if the canonical URL does not?
No. og:url should match the canonical exactly, so if the canonical has no www, neither does og:url.
What if the page is shared before the og:image URL is updated?
Platforms cache what they fetched. After the fix, run the URL through each platform’s debugger to make it fetch again. Posts already shared may keep the old card until the cache expires.
Which product detects this
Probeo checks this on every page of your site as part of Site Clarity. This page explains one instance; the product tells you every page that has it.