How to choose which photo will appear on Facebook when sharing a page?

0

I just made a website for a friend that will be used for an event, the middle of the site has a part that features the special guests with description and everything. When it comes to sharing the site link on Facebook, it appears the photo of one of the guests and not the first photo present on the site, which is supposed to be the poster.

Is there any kind of command for me by the photo I want to be the "main" photo of the site?

    
asked by anonymous 30.10.2016 / 14:32

1 answer

3

For integration with Facebook, you need OpenGraph meta tags.

The image is specifically this:

<meta property="og:image" content="https://dominio/imagem"/>

In this case, you can even select a specific image for Facebook, with the most suitable clipping for the display, and it does not necessarily have to be one used on the page.

If you want to add multiple images, just put the tag more than once. In this case, Facebook will prioritize them in the order that the meta tags were placed in the code, from first to last, but depending on context and format, you can use others. See more details and the ideal dimensions of the image in the official documentation link at the end of the answer.

Obviously, for a better user experience, the image has to make sense in context, so it's convenient that it's something that the user will actually find by clicking on the link. For example, a version or clipping of some relevant part of the poster, or a reformatted version for display on Facebook.

Watch out for all the tags needed to specify the object's settings, so that Facebook recognizes the data.

More details in the specification:

  

Facebook Open Graph - Object Properties

    
30.10.2016 / 14:36