WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: SEO by Yoast] Open Graph not working with Facebook (17 posts)

  1. Kenworts
    Member
    Posted 1 year ago #

    For some reason Facebook is not taking the data that is inside open garph meta tags, I have no idea why. I've tried searching for a solution, tried removing plugins etc but nothing has helped.

    My site: http://ecomparo.lt

    The Opengraph code:

    <!-- This site is optimized with the Yoast WordPress SEO plugin v1.2.8.7 - http://yoast.com/wordpress/seo/ -->
    <title>eComparo.lt | Palyginkite greitąsias paskolas ir pasirinkite geriausią</title>
    
    <link rel="stylesheet" href="http://ecomparo.lt/wp-content/plugins/sitepress-multilingual-cms/res/css/language-selector.css?v=2.6.0" type="text/css" media="all" />
    <meta name="description" content="eComparo.lt lygina Lietuvos greitųjų kreditų bendrovių pasiūlymus, kad Jūs galėtumėte pasiskolinti geriausiomis sąlygomis."/>
    <link rel="canonical" href="http://ecomparo.lt/" />
    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="@eComparoLT">
    <meta name='twitter:image' content='http://ecomparo.lt/ecomparo-lt-logo.png'>
    <meta name="twitter:description" content="eComparo.lt lygina Lietuvos greitųjų kreditų bendrovių pasiūlymus, kad Jūs galėtumėte pasiskolinti geriausiomis sąlygomis.">
    <meta property='og:locale' content='lt_LT'/>
    <meta property='og:title' content='eComparo.lt | Palyginkite greitąsias paskolas ir pasirinkite geriausią'/>
    <meta property='og:description' content='eComparo.lt lygina Lietuvos greitųjų kreditų bendrovių pasiūlymus, kad Jūs galėtumėte pasiskolinti geriausiomis sąlygomis.'/>
    <meta property='og:url' content='http://ecomparo.lt/'/>
    <meta property='og:site_name' content='eComparo.lt'/>
    <meta property='og:type' content='article'/>
    <meta property='og:image' content='http://ecomparo.lt/ecomparo-lt-logo.png'/>
    <meta property='og:image' content='http://ecomparo.lt/ecomparo-lt-logo.png'/>
    <!-- / Yoast WordPress SEO plugin. -->


    When posting URL to Facebook:
    http://i.imm.io/K7sJ.png

    Please help!

  2. cocoonfx
    Member
    Posted 1 year ago #

    I have the same problem, yoast is puting a ' into the meta property i.e

    <meta property='og:url' content='http://www.cocoonfxmedia.co.uk/Blog/'/>

    Should be :
    <meta property="og:url" content="http://www.cocoonfxmedia.co.uk/Blog/">

    Also it defaults to us_EN as well when we
    <meta property='og:locale' content='en_US'/>

    This should then give you the correct location.
    <meta property="og:locale" content="en_GB">

    Please advise ASAP how to fix the Open Graph issue.

  3. abehjat
    Member
    Posted 1 year ago #

    Go to the plugin folder for Yoast SEO (called wordpress-seo)

    Open the frontend directory, and you will find the file called "class-opengraph"

    You can modify the php code where instead of a single quote ( ' ), you can use a double quote through escaping mechanism. Here is an example:

    /**
    	 * Display an OpenGraph image tag
    	 *
    	 * @param string $img Source URL to the image
    	 *
    	 * @return bool
    	 */
    	private function image_output( $img ) {
    		if ( empty( $img ) )
    			return false;
    
    		$img = trim( apply_filters( 'wpseo_opengraph_image', $img ) );
    		if ( !empty( $img ) ) {
    			if ( strpos( $img, 'http' ) !== 0 ) {
    				if ( $img[0] != '/' )
    					return false;
    
    				// If it's a relative URL, it's relative to the domain, not necessarily to the WordPress install, we
    				// want to preserve domain name and URL scheme (http / https) though.
    				$parsed_url = parse_url( home_url() );
    				$img        = $parsed_url['scheme'] . '://' . $parsed_url['host'] . $img;
    			}
    
    			if ( in_array( $img, $this->shown_images ) )
    				return false;
    
    			array_push( $this->shown_images, $img );
    
    			echo "<meta property=\"og:image\" content=\"" . esc_url( $img ) . "\"/>\n";
    			return true;
    		}
    
    	}
  4. alexluchini
    Member
    Posted 1 year ago #

    I am having this same problem. No matter what I try - I can't get a title, image or description passed to Facebook even though the Open Graph information is there.

    This is what my header info looks like using Yoast SEO:

    <meta name="twitter:card" content="summary"/>
    <meta name="twitter:site" content="@https://twitter.com/1houseofpeace"/>
    <meta name='twitter:image' content='http://i1.wp.com/onehouseofpeace.org/wp-content/uploads/2013/04/Tender-Holding.jpg?fit=300%2C300'/>
    <meta name="twitter:description" content="In allowing ourselves to fully experience pain, in being with it with presence and compassion, we embrace the lessons we are here to learn. We grow."/>
    <meta property='og:locale' content='en_US'/>
    <meta property='fb:admins' content='1637053757'/>
    <meta property='og:title' content='Tender Holding -- the Grace of Being with Pain | One House of Peace'/>
    <meta property='og:description' content='In allowing ourselves to fully experience pain, in being with it with presence and compassion, we embrace the lessons we are here to learn. We grow.'/>
    <meta property='og:url' content='http://onehouseofpeace.org/tender-holding-the-grace-of-being-with-pain/'/>
    <meta property='og:site_name' content='One House of Peace'/>
    <meta property='og:type' content='article'/>
    <meta property='og:image' content='http://i1.wp.com/onehouseofpeace.org/wp-content/uploads/2013/04/Tender-Holding.jpg?fit=300%2C300'/>
    <meta property='og:image' content='http://onehouseofpeace.org/wp-content/uploads/2013/04/Tender-Holding-1024x1024.jpg'/>
    <!-- / Yoast WordPress SEO plugin. -->

    I am using Jetpack as my social share plugin and am using the code from Yoast's website to disable the OG tags from Jetpack.

    I have deactivated all the other plugins besides Jetpack and Yoast SEO and it still didn't work.

    What am I missing?

    This is what it looks like when I try to share to FB: https://www.dropbox.com/s/4rujjd5q23uslnq/fb_screen_shot.tiff

  5. alexluchini
    Member
    Posted 1 year ago #

    I just fixed this for myself. I found the solution in another post.

    I simply had to remove the trailing slash after my custom permalink and it works perfectly now.

  6. dunmerciful
    Member
    Posted 12 months ago #

    Witch triling slash ?? give us some more info.

  7. alexluchini
    Member
    Posted 11 months ago #

    I wen't to: Settings > Permalinks

    I had custom permalinks set and it looked like this: example.com/%postname%/

    I changed it to this: example.com/%postname%

    By deleting the trailing slash. That's it.

  8. alexluchini
    Member
    Posted 11 months ago #

    I went to: Setting > Permalinks

    I had custom permalinks set and it looked like this: example.com/%postname%/

    I deleted the trailing slash so now it looks like this: example.com/%postname%

    That's it.

  9. alexluchini
    Member
    Posted 11 months ago #

    I went to Setting > Permalinks

    I had a custom permalink set and it looked like this: example.com/%postname%/
    I changed it to: example.com/%postname%

    by deleting the trailing slash at the end. That's it.

  10. dunmerciful
    Member
    Posted 11 months ago #

    It's not working for me :(( I changed the permalinks and nothing changes when i try to post an article into facebook. my web is predlagamfilm.hol.es
    take a look pls.

    Tnx !

  11. alexluchini
    Member
    Posted 11 months ago #

    Can you confirm that you actually have the Open Graph settings set up correctly within Yoast SEO?

    Also, I am using Jetpack Share so I also had to add a function to my functions file that disables Jetpacks Open Graph Tags (just google: disable jetpack open graph).

    If you're using some other share plugin than there may be another conflict.

  12. dunmerciful
    Member
    Posted 11 months ago #

    I gonna explain you my case.

    Everything was working OK before i update the plugin.

    I try a couple of things.

    Changing the template - not work
    Reinstalling the plugin with the defaut config - not work
    Disable all plugins leaving only SEO by Yoast - not work

    Yes, i've got Open Graph checked in the configuration in within the plugin.

    Best regards.

  13. alexluchini
    Member
    Posted 11 months ago #

    In that case I would revert back to the old plug-in version and start a new thread.
    That seems specifically related to the latest update release.

  14. dunmerciful
    Member
    Posted 11 months ago #

    Do you know how to downgrade the version of the SEO plugin ?

  15. alexluchini
    Member
    Posted 11 months ago #

    Well, you should have backed up the site before doing an update and then you would have access to the old plug-in files and be able to copy the old files into the plug-in folder via FTP. If you DIDN'T do that...than I don't know how to help you.

  16. dunmerciful
    Member
    Posted 11 months ago #

    I should do it next time when i make any update :) lol

    Thank you very much for your help !!!

  17. Nick Ker
    Member
    Posted 11 months ago #

    ME TOO
    OpenGraph meta is not working for me on FB, G+ or LinkedIn. I just get the title, link and thumbnail. No description, and sometimes not the specified thumbnail.

  18. dunmerciful
    Member
    Posted 11 months ago #

    Nick Ker. Try alexluchini solution whit permalinks.

Topic Closed

This topic has been closed to new replies.

About this Topic