OpenGraph's og:image metatag does not pick up the link-specific image

I have the following snippet of code, but facebook is randomly picking up another image that is not part of the specific link for this, the og:image as below.

<meta property="og:type" content="website">
<meta property="og:title" content="Acabamentos e Revestimentos">
<meta property="og:description" content="Acabamentos e Revestimentos Guarapari é o Guia Comercial de Guarapari com as melhores opções de Acabamentos e Revestimentos do mercado local.">
<meta property="og:url" content="http://www.guaraparivirtual.com.br/acabamento-e-revestimento-guarapari">
<meta property="og:image" content="http://www.guaraparivirtual.com.br/imagens/guia-comercial-rede-social.jpg">
<meta property="fb:app_id" content="966242223397117">

All other information appears perfectly, just does not pick up the image specified in the link og:image.

Author: Gladison, 2018-05-04

1 answers

The problem is in the declaration of the !DOCTYPE of the pages of the site:

           inválido
              ↓
<!DOCTYPE html!>

The exclamation ! after html is invalid, and with that the Facebook API is not validating the HTML of the page, considering that the meta tags are not in <head>, as shown by the Open Graph object Debugger :

insert the description of the image here

With this, the tool randomly chooses an image from the page.

See also the error pointed out in the HTML validator do W3C :

insert the description of the image here

Solution: remove the ! and leave only <!DOCTYPE html>, which is the correct statement for the HTML5 standard.

To test, open this debugger link and you will see the correct image:

Https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fdvdteste.hospedagemdesites.ws%2Fstack%2Ft6.php

The link above the debugger points to this test page that I created by copying the source your website and fixing the problem.

 1
Author: Sam, 2018-05-10 01:01:45