• Resolved Ashish

    (@ashishpatel1992)


    I dont want to use automatically fetch system for og:image
    I would like Yoast to get custom field image url to be posted as og:image and twitter card image
    What should I add to my functions.php ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can start with changing the image URL itself. Unfortunately, this isn’t controlled by the Yoast SEO plugin but by WordPress. You may refer here: https://wordpress.stackexchange.com/questions/151485/how-to-change-image-url

    Thread Starter Ashish

    (@ashishpatel1992)

    Hi,
    I think you didnt get my question correctly.
    Lets assume a situation where I have a post and Yoast automatically takes featured image or any other image from the page and put it as og:image.
    Now if I want to fix a specifc image to be displayed at og:image I need to goto the post , scroll to yoast and facebook sharing option where I can upload my image, to override all other images.

    What I am exactly looking for is for example I have a custom field name
    my_custom_image.
    Now I want yoast to always take the image from my_custom_image field. So I dont need to upload image manually for every post.

    You can use the wpseo_opengraph_image filter to programmatically add the og:image URL from the custom field.

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

The topic ‘Adding custom image url to og image’ is closed to new replies.