WordPress.org

Forums

WordPress SEO by Yoast
Change the "og image" property (10 posts)

  1. carollynn
    Member
    Posted 1 year ago #

    Under the social settings I have set the default image but I notice that in addition to the primary, there are a bunch of og images, some of which I do not want to be used. Is there a way to remove all of those image attributes and ONLY use the default?

    https://wordpress.org/plugins/wordpress-seo/

  2. sdaveCL
    Member
    Posted 1 year ago #

    Same problem here. With an image heavy post that I have I can't get Google+ to pick up the Featured Image because there are too many og:image tags in the <head>.

  3. carollynn
    Member
    Posted 1 year ago #

    Exactly... you said it better than I did. The problem is that my primary image still doesn't show in shares on Facebook or Google, as you said. But I got a whole bunch of useless ones. Would love to find out if anyone has a solution.

  4. baldruus
    Member
    Posted 1 year ago #

    I'm having the same problem here. Primary image is not showing correctly when I share the post on Facebook. Sometimes it's showing the image from an older post (like it would be cached) or sometimes is not showing any image.
    I'm sharing posts with Jetpack plugin.

  5. BitSin
    Member
    Posted 1 year ago #

    I'm also having same problem. Using "Facebook" plugin along with WPSEO with Facebook Social settings turned on.

    Example: Facebook debugger of my URL

    When sharing on Facebook, it's picking the smallest og:image tag!

    Any workaround?

  6. sdaveCL
    Member
    Posted 1 year ago #

    This post describes how to strip all but the featured image og:image tag of the post from the <head>:

    http://webgilde.com/en/wordpress-seo-facebook-image-open-graph/

    Takes a snippet of code added to your theme's functions.php to do it.

    The exact snippet I added was this:

    add_filter('wpseo_pre_analysis_post_content', 'mysite_opengraph_content');
    function mysite_opengraph_content($val) {
    return preg_replace("/<img[^>]+>/i", "", $val);
    }
  7. _alexsmith1
    Member
    Posted 1 year ago #

    Thanks sdaveCL, your snippet worked for me!

  8. baldruus
    Member
    Posted 1 year ago #

    These days I tried to solve in different way.
    I disabled automatic posting from Jetpack and installed a new plugin to auto-post to facebook: http://wordpress.org/plugins/social-networks-auto-poster-facebook-twitter-g/

    Now it works like a charm with WordPress SEO.

  9. marvin_edward
    Member
    Posted 4 months ago #

    Within the Yoast plugin you can simply switch it. Go to the right page and search for the social tab at the wordpress seo for yoast there you can change the og:image

  10. sdaveCL
    Member
    Posted 4 months ago #

    marvin_edward the concern is not how to set a default og:image.

    The problem is a bunch of og:images automatically added to the <head> which prevents social networks from picking up the one you want when sharing a page/post.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress SEO by Yoast
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.