Looking for a code snippet to display openGraph image

#566971
  • Resolved Olga Prokopenko
    Rank Math free

    Hello! My Open Graph image does not work. I went through few links and articles regarding the same issue, inspected elements in my browser, and there is no tag for image, although I made sure I have it in settings. I don’t want to switch off any plugins as it took a while finding the correct ones, therefore, I need them all. I went through the article of the bad-listed plugins and I don’t have any of them.
    Could you, please, suggest the code snippet that I can use to resolve this issue quick and easy? I did not find any in the snippets article.
    And if you will kindly share with me this snippet, could you also please guide me if I need to create a rankmath.php file?

    Thank you,
    Regards,
    Olga

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math support.

    We apologize for the inconvenience caused by the missing og:image on your page. We have inspected your website and found that the issue is caused by the small size of your image (300x112px). Rank Math requires a larger image to generate the og:image tag.

    To fix this issue, please try the following steps:

    • Replace the Rank Math OpenGraph image with a larger image. The recommended image dimension is 1200x630px.
    • Clear your site cache and browser cache and reload your page.
    • Check your page source code and see if the og:image tag is present. You can check you source code by visiting view-source:https:yoursite.com

    We have tested this solution on your website and it works. You can see the screenshots of our test in the sensitive data section.

    Please let us know if this resolves the issue. If you have any further questions or concerns, please feel free to reach out to us.

    Best regards

    Hello, Great!
    Thank you very much for your reply, I tried what you suggested and replaced it with the image you tested, unfortunately, still no open graph image showing on Facebook. I tested different browsers, cleared cache of them, but still the same. I don’t have any caching on my website and my hosting doesn’t have it either, so it’s not cache. Not only that, but I also tried a few other images to see if it will work with them, as my client would prefer to have this image https://www.olgasfood.com/wp-content/uploads/2023/04/of_pelmni_a.jpg instead of stock image for her open graph image.
    https://www.dropbox.com/s/iv7jtlmdei35eoi/Screenshot%202023-05-02%20at%2014.19.09.png?dl=0
    Thank you,
    Regards,
    Olga

    Hello,

    The image is already shown by using the Facebook Debugger Tool. If you have recently made changes to the Opengraph tags, you can use that tool to clear the cache from Facebook.

    Please update the Opengraph image on your homepage with the image you prefer, then clear your website’s cache and use the “Scrape Again” button to refresh Facebook’s cache.

    Hope that helps.

    Thank 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.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Looking for a code snippet to display openGraph image’ is closed to new replies.