After researching a lot I found that there are quite a few very common issues with the “Yoast SEO plugin” that haven’t been resolved yet.
I also ran into those issues (which is why I was researching) and strangely enough there are no solutions for many of those issues yet, although they are so common.
Many users of the plugin report the same issues, but in the WordPress Support forums nobody seems to help them. There is no solution – even for issues that have been reported half a year ago!
I hope that my question thread will not only help myself, but other users who ran into the same issues and have been looking forever for a good solution.
Information:
My blog: http://zoomingjapan.com
WordPress Version: 3.5.1
Yoast plugin version: 1.3.4.4
Other: I recently changed from All in ONE SEO to Yoast.
Dublicate Title when sharing on Google+
While search engines and other sharing services don’t produce double titles, Google+ does.
It is a very common issue.
Some possible solutions are:
Look at your html code (header.php) and check if there’s a double “og:title” tag. If yes, remove. Here are some other solutions that might work.
If this doesn’t help, check if you use any plugins that generate the “og:title” tag.
The Yoast plugin does this, but you can turn it off.
I heard that with a recent Jetpack update, you also get the open graph tags, but you can turn it off using this filter:
add_filter( 'jetpack_enable_open_graph', '__return_false' );
as suggested here.
None of these have worked for me. I added the filter to get rid of the one in Jetpack and I turned the one in Jetpack off. I use my own code for open graph:
//Adding the Open Graph in the Language Attributes
function add_opengraph_doctype( $output ) {
return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
}
add_filter('language_attributes', 'add_opengraph_doctype');
//Lets add Open Graph Meta Info
function insert_fb_in_head() {
global $post;
if ( !is_singular()) //if it is not a post or a page
return;
echo '<meta property="fb:admins" content="377035309011137" />';
echo '<meta property="fb:app_id" content="235244769925765" /> ';
echo '<meta property="og:title" content="' . get_the_title() . '"/>';
echo '<meta property="og:type" content="article"/>';
echo '<meta property="og:url" content="' . get_permalink() . '"/>';
echo '<meta property="og:site_name" content="Zooming Japan - Detailed Japan Guide"/>';
if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image
$default_image="http://zoomingjapan.com/wp-content/themes/alltuts/images/linkback_600x156ver2.jpg"; //replace this with a default image on your server or an image in your media library
echo '<meta property="og:image" content="' . $default_image . '"/>';
}
else{
$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
echo '<meta property="og:image" content="' . esc_attr( $thumbnail_src[0] ) . '"/>';
}
echo "n";
}
add_action( 'wp_head', 'insert_fb_in_head', 5 );
Removing this code will get rid of the duplicate title in Google+, but of course Facebook sharing cannot generate the right meta title and description anymore.
Any other solutions for this problem?
EDIT:
So when I try to share something on Google+ I get a “double title issue” as seen here:
I want to either have “Title 1” or “Title 2”, but currently it’s “Title 1 Title 2”
One title is the one I typed in WordPress when publishing the post and the other one is the meta title I typed in the SEO Yoast plugin. When sharing on Facebook etc. I don’t have the “double title issue”.
You have two titles because Yoast adds an og:title tag, and then you add another one with your own code, what’s unexpected about this result? so remove the one you add with your code, problem solved.
Facebook’s Debugger doesn’t like your page because you have two og:url tags, one added by Yoast, then another added by you.
To remove wordpress seo by yoast plugin default open graph meta tags just follow below given steps: –
Deselect this option to disable default open graph meta tags.
Now analyze the page source of your blog to see the effects.