• Resolved jchambo

    (@jchambo)


    Greetings,

    I’m seeing an issue where my Facebook shares via URL’s are not populating the right Title / Description data. It just posts the Title alone in both fields.

    See screenshots for reference:

    Facebook Share
    Yoast Facebook SEO Settings
    Facebook Debug Information

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Easter Sunday is April 16th! Book your Photo Shoot early and beat the crowd! Contact me today for your Photographer needs in Plainfield / Romeoville, IL" />
    <meta name="robots" content="noodp" />
    <meta property="og:locale" content="en_US" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Photography Event: Book Your Easter Photo Shoot in Plainfield / Romeoville, IL - JChambo" />
    <meta property="og:description" content="Easter Sunday is April 16th! Book your Photo Shoot early and beat the crowd! Contact me today for your Photography needs in Plainfield / Romeoville, IL" />
    <meta property="og:url" content="https://jchambo.com/events/event-book-easter-photo-shoot" />
    <meta property="og:site_name" content="JChambo" />
    <meta property="article:publisher" content="https://www.facebook.com/JChamboWeb" />
    <meta property="article:author" content="https://www.facebook.com/JChamboWeb/" />
    <meta property="article:tag" content="Easter" />
    <meta property="article:tag" content="Photographer" />
    <meta property="article:tag" content="Photography" />
    <meta property="article:tag" content="Plainfield" />
    <meta property="article:tag" content="Romeoville" />
    <meta property="article:section" content="Events" />
    <meta property="article:published_time" content="2017-02-22T18:52:03+00:00" />
    <meta property="article:modified_time" content="2017-02-23T23:47:33+00:00" />
    <meta property="og:updated_time" content="2017-02-23T23:47:33+00:00" />
    <meta property="fb:admins" content="10153003941804624" />
    <meta property="og:image" content="https://jchambo.com/wp-content/uploads/2017/02/01-homemade-easter-egg-dye-eggs.jpg" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:description" content="Easter Sunday is April 16th! Book your Photo Shoot early and beat the crowd! Contact me today for your Photography needs in Plainfield / Romeoville, IL" />
    <meta name="twitter:title" content="Photography Event: Book Your Easter Photo Shoot in Plainfield / Romeoville, IL - JChambo" />
    <meta name="twitter:site" content="@JChamboWeb" />
    <meta name="twitter:image" content="https://jchambo.com/wp-content/uploads/2017/02/01-homemade-easter-egg-dye-eggs.jpg" />
    <meta name="twitter:creator" content="@JChamboWeb" />
    <meta name="generator" content="Powered by LayerSlider 6.1.6 - Multi-Purpose, Responsive, Parallax, Mobile-Friendly Slider Plugin for WordPress." />
    <meta name="generator" content="WordPress 4.7.2" />
    <meta name="msapplication-config" content="/wp-content/uploads/fbrfg/browserconfig.xml?v=yyx8Mdrxzd" />
    <meta name="theme-color" content="#ffffff" />
    <meta name="generator" content="Powered by Visual Composer - drag and drop page builder for WordPress." />
    <meta name="generator" content="Powered by Slider Revolution 5.2.6 - responsive, Mobile-Friendly Slider Plugin for WordPress with comfortable drag and drop interface." />
    <meta property="og:title" content="Event: Book Your Easter Photo Shoot" />
    <meta property="og:description" content="Event: Book Your Easter Photo Shoot" />
    <meta property="og:site_name" content="JChambo" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="https://jchambo.com/events/event-book-easter-photo-shoot" />
    <meta property="og:image" content="https://jchambo.com/wp-content/uploads/2017/02/01-homemade-easter-egg-dye-eggs.jpg" />
    <meta itemprop="name" content="Event: Book Your Easter Photo Shoot" />
    <meta itemprop="description" content="Event: Book Your Easter Photo Shoot" />
    <meta itemprop="image" content="https://jchambo.com/wp-content/uploads/2017/02/01-homemade-easter-egg-dye-eggs.jpg" />

    As you can see, the debug information shows that it’s catching the correct og:title and og:description, but it’s not populating it correctly as it seems to be grabbing a different og:title and og:description instead.

    Is this an issue with Yoast, Facebook or my theme? And how can I get it working correctly?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jchambo

    (@jchambo)

    EDIT: Here is the code from my functions.php file on my theme.

    Is is it safe to say this is the source of conflict? Can I simply just “delete” all of this code from the functions.php file since Yoast SEO is handling my Open Graph data? Will anything negative happen if I do so?

    /* OPEN GRAPH TAGS START */
    
    function scalia_open_graph() {
    	global $post;
    
    	$og_description_length = 300;
    
    	$output = "\n";
    
    	if (is_singular(array('post', 'scalia_pf_item'))) {
    		// title
    		$og_title = esc_attr(strip_tags(stripslashes($post->post_title)));
    
    		// description
    		$og_description = trim($post->post_excerpt) != '' ? trim($post->post_excerpt) : trim($post->post_content);
    		$og_description = esc_attr( strip_tags( strip_shortcodes( stripslashes( $og_description ) ) ) );
    		if ($og_description_length)
    			$og_description = substr( $og_description, 0, $og_description_length );
    		if ($og_description == '')
    			$og_description = $og_title;
    
    		// site name
    		$og_site_name = get_bloginfo('name');
    
    		// type
    		$og_type = 'article';
    
    		// url
    		$og_url = get_permalink();
    
    		// image
    		$og_image = '';
    		$attachment_id = get_post_thumbnail_id($post->ID);
    		if ($attachment_id) {
    			$og_image = wp_get_attachment_url($attachment_id);
    		}
    
    		
    		// Open Graph output
    		$output .= '<meta property="og:title" content="'.trim(esc_attr($og_title)).'"/>'."\n";
    
    		$output .= '<meta property="og:description" content="'.trim(esc_attr($og_description)).'"/>'."\n";
    
    		$output .= '<meta property="og:site_name" content="'.trim(esc_attr($og_site_name)).'"/>'."\n";
    
    		$output .= '<meta property="og:type" content="'.trim(esc_attr($og_type)).'"/>'."\n";
    
    		$output .= '<meta property="og:url" content="'.trim(esc_attr($og_url)).'"/>'."\n";
    
    		if (trim($og_image) != '')
    			$output .= '<meta property="og:image" content="'.trim(esc_attr($og_image)).'"/>'."\n";
    
    		// Google Plus output
    		$output .= "\n";
    		$output .= '<meta itemprop="name" content="'.trim(esc_attr($og_title)).'"/>'."\n";
    
    		$output .= '<meta itemprop="description" content="'.trim(esc_attr($og_description)).'"/>'."\n";
    
    		if (trim($og_image) != '')
    			$output .= '<meta itemprop="image" content="'.trim(esc_attr($og_image)).'"/>'."\n";
    	}
    
    	echo $output;
    }
    
    add_action('wp_head', 'scalia_open_graph', 9999);
    
    function scalia_open_graph_namespace($output) {
    	if (!stristr($output,'xmlns:og')) {
    		$output = $output . ' xmlns:og="https://ogp.me/ns#"';
    	}
    	if (!stristr($output,'xmlns:fb')) {
    		$output=$output . ' xmlns:fb="https://ogp.me/ns/fb#"';
    	}
    	return $output;
    }
    
    add_filter('language_attributes', 'scalia_open_graph_namespace',9999);
    
    /* OPEN GRAPH TAGS FINISH */
    Thread Starter jchambo

    (@jchambo)

    EDIT: That was it. I resolved it by removing my theme’s Open Graph Tags code in my functions.php file.

    Hope if someone else has this issue you check here first like I didn’t. lol, thanks anyway!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Facebook og:title and og:description not populating correct data from Yoast’ is closed to new replies.