<title>Site &mdash; Новости</title> <meta property="og:type" content="website" /> <meta property="og:title" content="<?=htmlspecialchars($result[0]['title'])?>" /> <meta property="og:description" content="<?=htmlspecialchars(strip_tags($result[0]['description']))?>" /> <meta property="og:url" content="<?=$_SERVER['REQUEST_URI']?>" /> <script src="https://yastatic.net/es5-shims/0.0.2/es5-shims.min.js"> </script> <script src="https://yastatic.net/share2/share.js"></script> <div class="ya-share2" data-services="vkontakte,facebook,odnoklassniki"></div> 

The problem is that in the vkontakte Dialog box, the title is not displayed correctly, the text is picked up from the usual <title> , and not from the og: title meta tag. description, img. But the odnoklassniki dialog box works as expected with og: title, og: description, and all the pictures fall. Tell me how to fix these shortcomings?

    2 answers 2

    Use the FB debugger: https://developers.facebook.com/tools/debug/ Most likely, you have cached the old version, so click "scrape again" if you see incorrect data.

    • Please try to publish detailed answers containing a specific example of the minimum solution, supplementing them with a link to the source. Answers –references (as well as comments) do not add knowledge to the Runet. - Nicolas Chabanovsky

    Look in the direction of the documentation https://tech.yandex.ru/share/doc/dg/add-docpage/

    To override the title, use the data-title attribute.

    For description use data-description

    And for the image data-image

    • one
      facebook doesn’t react to anything at all, or to data attributes, not to semantic markup. - amijin