Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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: Double title issue

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".

share|improve this question

closed as off-topic by birgire, Pieter Goosen, Johannes Pille, bungeshea, ialocin Oct 5 at 19:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – birgire, Pieter Goosen, Johannes Pille, bungeshea, ialocin
If this question can be reworded to fit the rules in the help center, please edit the question.

2  
Yes, one question per issue is better. Side note: it's a free plugin, assistance/support is not a given. –  brasofilo Jan 29 '13 at 5:02
    
@brasofilo Alright, done! :) –  japanworm Jan 30 '13 at 5:05
    
Ok, now, in all of this, what is the output you have (it's better to have it recorded here because your site will change) and what is the output you expect (or that works) ? –  brasofilo Jan 30 '13 at 5:13
    
@brasofilo Ok, I edited my question. I hope it's a bit clearer now. –  japanworm Jan 30 '13 at 15:38

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
Oh, that was actually one of the first things I did. After doing so, the double title issue was obviously solved, but Facebook couldn't generate the correct title and description anymore. No idea why. –  japanworm Jan 30 '13 at 16:33
    
disable your own code, then visit the url in the Facebook debugger to see if it generates errors. you could also remove just the title and url tags from your own code, leaving the other tags. –  Milo Jan 30 '13 at 16:45
    
I already did that, but then Facebook couldn't get the meta data. Using the debugger also just showed me the reason. I need to add the fb:admins and fb:app_id tags to Yoast, but the plugin won't let me. I get an error message (also a common issue as I've noticed when researching it). The plugin won't let you add anything manually and the buttons lead me to a page with the following error message: "403 Forbidden: Access to this resource on the server is denied!" Tried to modify my own code where I have the app_id, but it doesn't work. Debugger keeps complaining. –  japanworm Jan 31 '13 at 16:17
    
you already did what? remove the tags that Yoast adds and only add the tags with your code that Yoast lacks? at this point your issues don't really have anything to do with WordPress. –  Milo Jan 31 '13 at 17:16
    
The Yoast plugin has a lot of files. Would it be ok to just delete "wordpress-seo/frontend/class-opengraph.php"? However, it says it's already is "inactive". –  japanworm Jan 31 '13 at 17:28

To remove wordpress seo by yoast plugin default open graph meta tags just follow below given steps: -

  1. Log in to your WordPress Dashboard.
  2. Go to WordPress seo by yoast settings page.
  3. Navigate to Social.
  4. You will see an option named Add OpenGraph meta data at the top of page. Deselect this option to disable default open graph meta tags. Now analyze the page source of your blog to see the effects.
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.