Hello,
I apologize for the inconvenience you’re experiencing with the Open Graph image not displaying on Facebook after auto-sharing. Thank you for bringing this to our attention.
To resolve this issue, please ensure that you have added the Facebook/Twitter sharing images through Rank Math Meta Box, as shown in the following screenshot: Social Meta using Rank Math.
Additionally, double-check the dimension and format of the uploaded image. Facebook currently supports only jpeg, png, and gif image formats, and the recommended image size is 1200px X 630px. If the image’s dimension is too small or too large compared to the recommended image size, then individual social networks may not read your image correctly.
If you’ve already done this and are still facing issues, please feel free to assign this ticket to a staff member using the available buttons so we can further investigate the matter and assist you accordingly.
Thank you for your understanding and patience.
Sources:
Open Graph/Social Preview Image Is Not Displayed » Rank Math
How to Fix the ‘og: image’ Property Should Be Explicitly Provided » Rank Math
The #1 WordPress SEO Plugin in 2023 – Rank Math
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
I can check that you are using custom fields of your theme to add the images to the content, and that’s why our plugin is not able to detect them and add them as the OG image. Your theme must have added compatibility for Yoast, and that’s why it was working fine with Yoast.
I have added the following filter to your theme’s rank-math.php file to add the poster image as the OG image:
add_filter( "rank_math/opengraph/facebook/image", function( $attachment_url ) {
global $post;
if(is_single()) {
$attachment_url = 'https://image.tmdb.org/t/p/w600_and_h900_bestv2'.get_field('poster_path', $post->ID);
return $attachment_url;
}
return $attachment_url;
});
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
it works now just fine, thank you very much for that help u saved me ! Now i wonder could it be any bigger? i mean photo?
Hello,
The image size you are using can only be used to generate the small boxed preview. If you want to generate the preview with large images, you should use images with the 1200×600 size.
I hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
But link photos are much bigger u sure?
Hello,
Can you please share a URL of that photo?
At the moment, Rank Math will only render what images you have added to the appointed custom field. We also have no control over the preview you see on your end as this will depend entirely on the image you have added.
Looking forward to helping you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.