Site logo

[Resolved] Og image size – Width and Height

Home Forums Support [Resolved] Og image size – Width and Height

Home Forums Support Og image size – Width and Height

  • This topic has 5 replies, 2 voices, and was last updated 4 years ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2163416
    Craig

    Hi

    Is it possible to use a hook, displayed in wp_head to change the og metadata tags

    They are currently
    meta property=”og:image:width” content=”1500″
    meta property=”og:image:height” content=”1500″

    and I would like them to be

    meta property=”og:image:width” content=”1200″
    meta property=”og:image:height” content=”630″

    Thanks

    Craig

    #2163426
    David
    Staff
    Customer Support

    Hi there,

    no, you would need to check with the developer of the plugin ( I assume Yoast ) on how to filter those values. But I assume the width and height is taken from the image you told Yoast to use ?

    #2163436
    Craig

    Yes, I am using Yoast and the size is my original image size, but the image gets cut when sharing on Facebook and doesn’t display nicely.
    When you create an image in WordPress, WordPress creates about 5 or 6 other images of different sizes. How do I access these and see them in the media library? or make them available to be used?

    #2163640
    David
    Staff
    Customer Support

    I found this topic which provides some PHP Snippets that looks like what you need:

    https://travis.media/how-to-change-the-open-graph-image-size-in-yoast/

    This doc explains how to add PHP:

    https://docs.generatepress.com/article/adding-php/

    Probably worth speaking with Yoast on this though

    #2163760
    Craig

    Thanks David

    Much appreciate the help

    #2163920
    David
    Staff
    Customer Support

    You’re welcome

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.