Facebook debugger opens graphical image without scraping on first try

I have encountered this problem for the last couple of months. I run the wordpress site and I installed the Yoast Seo plugin. I also included meta tags in facebook and in this plugin. Now, whenever I try to share a link on my facebook facebook directly, on the first try, facebook cuts off the description and title of the message, but not "og: image". I have to refresh my page, and when I make a second attempt, then it cuts off the image or personally, I have to go to the facebook debugging tool https://developers.facebook.com/tools/debug/ and debug my email URL every time before how to share this with my fan page. I tried to manually place the facebook opengraph meta tags, also copied from other sites. Why this problem does not occur, but still I ran into the same problem. I would also like to mention here that I used Cloudfare's DNS servers. But I changed my DNS servers directly to the main web server DNS servers, but the problem still persists.

One of my friends was faced with the same issue on his website. Looks like we were missing something or do we need to add any A or CNAME records? Please help me with this.

thanks

+6
source share
4 answers

Here is the answer to this question from facebook:

The provided og: image properties are not yet available because new images are processed asynchronously. To provide access to the resources of the new URLs, specify the sizes using the og: image: width and og: image: height tags

so the fact is that for the first time facebook is not sure about the size of the image, so the image is not displayed during the second run, the image is already cached, so it can easily check the image sizes presented in 'og: image'.

To ensure that facebook displays the image the first time it is launched, the og: image: width and og: image: height values ​​are required.

+3
source

In accordance with the “sharing of best practices” on Facebook, Facebook must clear the page at least once by clicking on it to cache the image. Subsequent promotions will then be able to display the image.

The solution proposed by Facebook is to manually enter the URL using the debugging tool to pre-cache the image: https://developers.facebook.com/docs/sharing/best-practices#pre-cache-images

+2
source

I solved a similar problem. I also use WordPress with Cloudflare.

I installed Facebook Open Graph, Google+ and Twitter Card Tags (1.5.2) to add OG tags to my posts. I used the Facebook Open Graph Tag plugin update while maintaining the post option to migrate Facebook.

But Facebook still did not scratch the images from OG tags, even from the primed cache. (In subsequent tests using the Facebook debugging tool, Facebook didn’t even scratch OG tags. Using “See what our scraper tool sees for your URL”, Facebook only cut a few lines from the header, not the full html header),

For some reason, apart from my humble understanding, disabling Cloudflare Railgun solved the problem for me.

Railgun speeds up the connection between each CloudFlare data center and the origin server, so requests that cannot be served from the CloudFlare cache are nevertheless very fast.

This option can be found on the CloudFlare settings page for your domain.

Hope this will be helpful.

0
source

If you use any type of prerenderer, facebook is not like.
So just deleting this facebookexternalhit line in line 20 will help.
This is an official file.

https://gist.github.com/thoop/8165802

0
source

Source: https://habr.com/ru/post/981535/


All Articles