Support » Plugin: Jetpack by WordPress.com » Jetpack 2.6 OpenGraph image problem

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Looking at your site, I see 2 sets of Open Graph meta tags. One is correct, the other is not.

    Do you use extra plugins or functions to customize the output of the Open Graph meta tags? If so, could you deactivate them and let me know if it helps?

    There are no other plug-ins that generate OG tags, but to check I disabled all other plug-ins – the OG:image tags in the <head> were still incorrect.

    The incorrect og:image tag is in the section immediately after the <!– Jetpack Open Graph Tags –> comment, so it’s definitely being placed there by Jetpack.

    Just to re-iterate, this incorrect og tag only appeared after I updated Jetpack.

    For the sake of clarity, the problem affects all posts, not just those made since Jetpack was updated.

    One thing that this site does that is perhaps different to other sites – images aren’t embedded into the body of the post, they are uploaded but left as attachments and the theme displays them separately in the right margin.

    However, the previous version of Jetpack handled og:image tags correctly, it’s just a problem with the new version.

    Hope that helps track it down.

    I’ve reverted to Jetpack 2.5 for the moment, but even with that version it’s now adding this meta tag to the <head>

    <meta name=”twitter:site” content=”@jetpack” />

    Where is it getting @jetpack from? I can’t see any settings where that’s stated.

    Plugin Contributor Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    even with that version it’s now adding this meta tag to the <head>

    <meta name="twitter:site" content="@jetpack" />

    That’s the default twitter:site value, as it appears on all Jetpack sites.

    Could you check your theme’s functions.php for any functions that may be hooking into Jetpack’s Open graph tags or Jetpack’s Twitter Cards. If you find such function, could you paste it in this thread?

    That’s the default twitter:site value, as it appears on all Jetpack sites.

    But that’s wrong, isn’t it? So, for my site, I need that to be @TestDrivenUK. Can this be changed somewhere, other than editing the code?

    There was a function that added extra meta fields which I’ve now stripped out. I’ve re-upgraded to 2.6 to test it, and now the meta fields that Jetpack is placing in the head are:-

    <!– Jetpack Open Graph Tags –>
    <meta property=”og:type” content=”article” />
    <meta property=”og:title” content=”New Volvo V60 Polestar announced” />
    <meta property=”og:url” content=”http://www.testdriven.co.uk/2014-volvo-v60-polestar/” />
    <meta property=”og:description” content=”The new Volvo V60 Polestar has been revealed. Although available globally in both saloon S60 and estate V60 guises, only the estate model will be offered in the UK.” />
    <meta property=”og:site_name” content=”TestDriven” />
    <meta property=”og:image” content=”http://wordpress.com/i/blank.jpg” />
    <meta name=”twitter:site” content=”@jetpack” />
    <meta name=”twitter:card” content=”summary” />

    So, to my mind, the twitter:site value is wrong, and the og:image value isn’t finding the attached images.

    Just to be clear, this site isn’t hosted on wordpress.com.

    Plugin Contributor Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    There was a function that added extra meta fields which I’ve now stripped out. I

    That’s probably what was causing the issue.

    So, for my site, I need that to be @TestDrivenUK. Can this be changed somewhere, other than editing the code?

    Try adding the following code to your theme’s functions.php file:

    function tweakjp_custom_twitter_site( $og_tags ) {
    	$og_tags['twitter:site'] = '@TestDrivenUK';
    	return $og_tags;
    }
    add_filter( 'jetpack_open_graph_tags', 'tweakjp_custom_twitter_site', 11 );

    I think I’ve unravelled this issue now.

    The short version appears to be that Jetpack has *never* worked for this site as far as OpenGraph is concerned, and that’s why the additional function had been added to the theme.

    In class.jetpack-post-images.php lines 190-206 contain a function that strips out attached images if they have not been inserted in the body of the post. For this particular site, images are never inserted, they are left as attachments and displayed by the theme separately in the right margin. In effect, Jetpack has always been stripping out the images before generating the OG tags, so we’d obviously tacked on our own code in the theme to fix this.

    In the latest update for Jetpack, you’ve added a fallback that uses http://wordpress.com/i/blank.jpg as the og:image if no other images were found. With all the real images stripped out and Jetpack adding a new fallback image, that’s all that Facebook had to play with, hence the blank images.

    What I’m going to do now is disable Jetpack’s OG functions and we’ll handle it ourselves within the theme’s functions.php.

    For the moment, I’ve done this by editing the plug-in’s files, but is there an easier way I can do this? A filter I can add to the theme’s functions.php, perhaps?

    Plugin Contributor Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    What I’m going to do now is disable Jetpack’s OG functions and we’ll handle it ourselves within the theme’s functions.php.

    For the moment, I’ve done this by editing the plug-in’s files, but is there an easier way I can do this? A filter I can add to the theme’s functions.php, perhaps?

    You can use the following filter:

    add_filter( 'jetpack_enable_open_graph', '__return_false', 99 );

    “Me too”

    JetPack 2.6 and ‘All In One SEO Pack’ 2.1 and ‘Atahualpa’ 3.7.12
    (SEO inside Atahualpa theme is disabled).

    Facebook debug shows…

    !-- Jetpack Open Graph Tags -->
    <meta property="og:image" content="http://wordpress.com/i/blank.jpg">
    
    <!-- All in One SEO Pack 2.1 by Michael Torbert of Semper Fi Web Design[391,398] -->
    <meta property="og:image" content="http://stopthekilling.org.uk/wp-content/plugins/all-in-one-seo-pack/images/default-user-image.png">

    Deactivate the ‘All In One SEO Pack’ and then get a warning instead…

    Provided og:image is not big enough. Please use an image that’s at least 200×200 px. Image ‘http://stopthekilling.org.uk/wp-content/plugins/all-in-one-seo-pack/images/default-user-image.png’ will be used instead.

    So, sure looks like JetPack is adding in the blank image when it shouldn’t be.

    This website has just a few pages; no posts.

    ~Andrew~

    Plugin Contributor Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    @andrewrh Your problem is a bit different.

    Jetpack includes a function that checks for Open Graph plugins and automatically disables Jetpack’s Open Graph meta tags if you already use another Open Graph plugin. That function didn’t include the All in One SEO plugin as it didn’t propose any Open Graph management options in the past.

    I just checked the plugin page again, and it seems the plugin authors added a new Open Graph feature in version 2.1, that was released last week.
    I’ve consequently updated Jetpack, and starting in the next release our Open Graph tags will be automatically disabled when All In One SEO is active.
    You can see the changeset here, and apply the changes to your own site until Jetpack 2.6.1 is released some time next week

    Thanks for letting me know about the changes in All In One SEO!

    I appear to be suffering a similar issue, but the fixes are not working for me. (website http://www.imageworkshop.com)
    I am using Yoast WordPress SEO plugin, and also have Jetpack installed.

    I have attempted to disable the OpenGraph produced by Jetpack using the code in my fucntions.php, but this does not appear to have removed the values (or at least I still have a double up, but perhaps these are from another plugin?)
    add_filter( 'jetpack_enable_open_graph', '__return_false', 99 );

    When I test my site with Facebook debug tools, it is still complaining about multiple OpenGraph values.
    https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.imageworkshop.com%2F

    Have I missed something here?

    Plugin Contributor Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    @gearu If you use both Jetpack and WP SEO, you do not need to add any code to your theme’s functions.php. Jetpack’s Open Graph meta tags are automatically deactivated when WP SEO is active.

    One set of tags is added by WP SEO, but the other one is most likely added by another plugin, or your theme. Looking at your site, it seems you managed to find out which one since the duplicated tags have disappeared.

    If you experience other issues in the future, could you please start your own thread, as per the Forum Welcome?
    http://wordpress.org/support/plugin/jetpack#postform

    Thank you!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Jetpack 2.6 OpenGraph image problem’ is closed to new replies.