• Resolved Oliver Campion

    (@domainsupport)


    We have found an issue regarding the use of this plugin and .webp / .avif format images.

    When Open Graph meta tags are used to specify the featured image as the og:image property for platforms like Facebook, the .webp / .avif image formats are not supported.

    We realise that if a .jpg was the originally uploaded image then this could be used instead but, if the originally uploaded image is also a .webp, this will not be possible.

    Is there a way to make sure that a .jpg version of an uploaded image always exists? “Output fallback images” option would not be sufficient where a .webp or .avif were the original format.

    Thank you,

    Oliver

Viewing 2 replies - 16 through 17 (of 17 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    @domainsupport Isn’t that line 20 is already doing?

    printf( '<meta name="og:image" class="wp_get_attachment_image_url" content="%s">' . PHP_EOL, esc_url( wp_get_attachment_image_url( get_post_thumbnail_id() ) ) );
    Thread Starter Oliver Campion

    (@domainsupport)

    I suspect that you have “Also generate fallback images in the original upload format” enabled. We don’t have this enabled because we only require the original .jpeg for the og:image meta.

    To confirm, we get this when uploading a .jpeg …

    <meta name="og:image" class="get_the_post_thumbnail_url" content="http://localhost/wp-content/uploads/2023/12/demo3-150x150.webp">
    <meta name="og:image" class="wp_get_attachment_image_url" content="http://localhost/wp-content/uploads/2023/12/demo3-150x150.webp">

    … and this when uploading a .webp …

    <meta name="og:image" class="get_the_post_thumbnail_url" content="http://localhost/wp-content/uploads/2023/12/demo3-1-150x150.webp">
    <meta name="og:image" class="wp_get_attachment_image_url" content="http://localhost/wp-content/uploads/2023/12/demo3-1-150x150.webp">

    … using your test plugin.

    That’s probably by design which I totally get.

    Anyway, it’s not a problem because the wrapper function that we developed handles both these scenarios for us.

Viewing 2 replies - 16 through 17 (of 17 total)

The topic ‘Open Graph protocol does not support webp’ is closed to new replies.