M a r k W o r r a l l . c o m
all articles / all Blog articles

Open Graph not finding correct Facebook image for HTTPS

Open Graph Image Not Found For Https

I created a webpage for a site I was working on and set the Open Graph path to the image to use when sharing it as a link via Facebook. Each time I tested sharing it the wrong image was being used. I know if there is any problem in finding the image, OG will just take one of the images (usually the first) from the page, which is what I observed it was doing.

I took the path from the page source and dropped it in the browsers, and the correct image displayed, so knew the image was ok.

I've had this problem before and as I generate the OG values dynamically in the backend, knew the code should work.

After a long search trying out many recommendations I found the solution, which is why I am writing this, to save others the time.

The difference with this site was it uses HTTPS. The 'og:image' property needed ':secure_url' appending to it. There was previously a bug where this didn't work, but that seems to be rectified now.

After adding ':secure_url' I went back to the Facebook debugger and re-scraped the page, and the correct image was now being displayed.

Add Comment




capthca1 capthca2 capthca3 capthca4 capthca5 capthca6