Support » Plugin: WP Facebook Open Graph protocol » [Plugin: WP Facebook Open Graph protocol] Double titles/description on Google

  • Resolved sdaveCL


    I initially added the Open Graph plugin to fix sharing on Facebook, because Facebook was ignoring the Featured Images chosen in WordPress (no og:image tag in the header). It worked great for that.

    I am having a problem with sharing on Google+ though.

    I have Yoast’s WordPress SEO plugin installed which already places some Open Graph tags to the header. WP Facebook Open Graph adds those yet again.

    So, whenever I try to share a link from my website on Google+ is shows the title and description twice. Facebook ignores the duplicates, but Google+ adds them inline.

    Is there any way to prevent this plugin from placing duplicate og:title and og:description tags in the title?


Viewing 2 replies - 1 through 2 (of 2 total)
  • // do title stuff
    		if (is_home() || is_front_page() ) {
    			$wpfbogp_title = get_bloginfo( 'name' );
    		} else {
    			$wpfbogp_title = get_the_title();
    		echo '<meta property="og:title" content="' . esc_attr( apply_filters( 'wpfbogp_title', $wpfbogp_title ) ) . '">' . "\n";
    		// do descriptions
    		if ( is_singular() ) {
    			if ( has_excerpt( $post->ID ) ) {
    				$wpfbogp_description = strip_tags( get_the_excerpt( $post->ID ) );
    			} else {
    				$wpfbogp_description = str_replace( "\r\n", ' ' , substr( strip_tags( strip_shortcodes( $post->post_content ) ), 0, 160 ) );
    		} else {
    			$wpfbogp_description = get_bloginfo( 'description' );
    		echo '<meta property="og:description" content="' . esc_attr( apply_filters( 'wpfbogp_description', $wpfbogp_description ) ) . '">' . "\n";

    I removed these two bunches of code from wp-facebook-ogp.php and that seems to have done the trick. Are there any other repercussions to removing this code?

    Never mind. I just realized there is a check box in WordPress SEO to add Open Graph tags that I forgot about. Unchecked that, added the code back to the php file, and it all works fine. *dunce*

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP Facebook Open Graph protocol] Double titles/description on Google’ is closed to new replies.