-1

I have a php page which from a $_GET receives the image to be displayed. A simple id which is placed in an echo.

I want people to be able to share this particular image. I have placed in the header a META tag which also uses $_GET to fill the content for og:image. When I inspect the page I can clearly see the correct data.

When I load the url in the Facebook debugger it uses the URL without the added data behind the '?'. Also using the share button results in seeing an empty image.

How can I make sure people will see the correct image when sharing?

Some other information : The site has a big banner above the custom image. When I don't use og:image it just takes this big banner as the displayed image which I don't want.

  • You need to update your `og:url` (and canonical URL, if used on the site) to include that GET parameter. (This will of course mean that you have different URLs, so likes/shares will be counted for those URLs individually.) – CBroe Jan 25 '16 at 12:08
  • Thanks for the reply. I've changed the og:url. It works in the debugger! I don't get any error messages and the preview looks great. But when I use the button I do not see an image. Any idea why that might be? – Ammar Al-Chalabi Jan 25 '16 at 13:57
  • If the debug tool shows the right info, everything should be ok. If sharing still shows something different, that is in most cases a local cache issue. – CBroe Jan 25 '16 at 14:19
  • @Cbroe I have been inspecting the Facebook popup. Most of the time the picture shows the complete URL without the data behind the '?' and sometimes it does. the debugger shows all links as good though so could this still be a cache issue? – Ammar Al-Chalabi Jan 26 '16 at 07:45

1 Answers1

0

For anyone who has a similar problem : I have found that the issue was with my jpg's. Not sure what went wrong but I re-saved them and it all works!

I use ImageOptim and Save for Web in Photoshop to reduce filesize so the problem may lie there.