Support for webp images og:image

#149299
  • Resolved Ahmad Hamid
    Rank Math free

    Hi
    Can you please add support for webp images.
    Lately I added pluging “Plus WebP” to switch to webp images and noticed the the og:image metas went missing.

    <meta property=”og:image” content=”…..webp”>
    <meta property=”og:image:width” content=”1200″>
    <meta property=”og:image:height” content=”628″>
    <meta property=”og:image:alt” content=”ddddا”>
    <meta property=”og:image:type” content=”image/webp”>

    After some investigation I found that class-image.php > is_valid_image_url() doesn’t have the webp among that valid image extensions.

    return in_array( $check[‘ext’], [ ‘jpeg’, ‘jpg’, ‘gif’, ‘png’], true );

    Is there a way I can added it without touching the image class ?

    Thanks

Viewing 1 replies (of 1 total)
  • Danial
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    According to Facebook for Developers,
    https://developers.facebook.com/docs/sharing/webmasters/#images

    og:image:type – MIME type of the image. One of image/jpeg, image/gif or image/png

    Since the restriction to those MIME/file types is mentioned for that property, that should also mean you can not use WebP for og:image.

    I hope this helps you with your issue.

    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 1 replies (of 1 total)

The ticket ‘Support for webp images og:image’ is closed to new replies.